frosty/lib/screens/settings/video_settings.dart
Tommy Chow 9c1be7e121 clean up settings: move keep-awake to chat, improve labels and section headers
- move keepScreenAwake from video to chat settings (store + UI)
- mute section headers (lighter weight, smaller, reduced opacity)
- add breathing room between app bar and first setting
- improve labels across general, video, and chat settings
- reorder store fields to logical grouping with organized reset

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 23:13:44 -07:00

84 lines
3.2 KiB
Dart

import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:frosty/screens/settings/stores/settings_store.dart';
import 'package:frosty/screens/settings/widgets/settings_list_switch.dart';
import 'package:frosty/utils.dart';
import 'package:frosty/widgets/section_header.dart';
import 'package:frosty/widgets/settings_page_layout.dart';
class VideoSettings extends StatelessWidget {
final SettingsStore settingsStore;
const VideoSettings({super.key, required this.settingsStore});
@override
Widget build(BuildContext context) {
return Observer(
builder: (context) => SettingsPageLayout(
children: [
const SectionHeader('Player', isFirst: true),
SettingsListSwitch(
title: 'Show video player',
value: settingsStore.showVideo,
onChanged: (newValue) => settingsStore.showVideo = newValue,
),
if (settingsStore.showVideo)
SettingsListSwitch(
title: 'Native player (experimental)',
subtitle: const Text(
'More performant video player with auto picture-in-picture and quality selection.',
),
value: settingsStore.useNativePlayer,
onChanged: (newValue) =>
settingsStore.useNativePlayer = newValue,
),
if (!Platform.isIOS || isIPad())
SettingsListSwitch(
title: 'Default to highest quality',
value: settingsStore.defaultToHighestQuality,
onChanged: (newValue) =>
settingsStore.defaultToHighestQuality = newValue,
),
if (Platform.isAndroid)
SettingsListSwitch(
title: 'Use fast video rendering',
subtitle: const Text(
'Uses a faster WebView rendering method. Disable if you experience crashes while watching streams.',
),
value: settingsStore.useTextureRendering,
onChanged: (newValue) =>
settingsStore.useTextureRendering = newValue,
),
const SectionHeader('Overlay'),
SettingsListSwitch(
title: 'Use custom video overlay',
subtitle: const Text(
'Replaces Twitch\'s default web overlay with a mobile-friendly version.',
),
value: settingsStore.showOverlay,
onChanged: (newValue) => settingsStore.showOverlay = newValue,
),
SettingsListSwitch(
title: 'Toggle overlay on long-press',
subtitle: const Text(
'Switch between Twitch\'s overlay and the custom overlay.',
),
value: settingsStore.toggleableOverlay,
onChanged: (newValue) =>
settingsStore.toggleableOverlay = newValue,
),
SettingsListSwitch(
title: 'Show latency',
subtitle: const Text(
'Displays the stream latency in the video overlay.',
),
value: settingsStore.showLatency,
onChanged: (newValue) => settingsStore.showLatency = newValue,
),
],
),
);
}
}