2021-12-28 22:52:29 -05:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_mobx/flutter_mobx.dart';
|
2022-01-04 02:58:02 -05:00
|
|
|
import 'package:frosty/screens/settings/stores/settings_store.dart';
|
2023-01-18 05:34:54 -05:00
|
|
|
import 'package:frosty/screens/settings/widgets/settings_list_slider.dart';
|
|
|
|
|
import 'package:frosty/screens/settings/widgets/settings_list_switch.dart';
|
|
|
|
|
import 'package:frosty/widgets/section_header.dart';
|
2021-12-28 22:52:29 -05:00
|
|
|
|
|
|
|
|
class VideoSettings extends StatelessWidget {
|
|
|
|
|
final SettingsStore settingsStore;
|
|
|
|
|
|
2023-04-29 11:34:28 -04:00
|
|
|
const VideoSettings({Key? key, required this.settingsStore})
|
|
|
|
|
: super(key: key);
|
2021-12-28 22:52:29 -05:00
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Observer(
|
2023-01-18 05:34:54 -05:00
|
|
|
builder: (context) => ListView(
|
2022-03-26 01:52:08 -04:00
|
|
|
children: [
|
2023-01-18 05:34:54 -05:00
|
|
|
const SectionHeader('Player'),
|
|
|
|
|
SettingsListSwitch(
|
|
|
|
|
title: 'Enable video',
|
2022-03-26 01:52:08 -04:00
|
|
|
value: settingsStore.showVideo,
|
|
|
|
|
onChanged: (newValue) => settingsStore.showVideo = newValue,
|
|
|
|
|
),
|
2023-10-22 18:38:32 -04:00
|
|
|
const SectionHeader('Overlay', showDivider: true),
|
2023-01-18 05:34:54 -05:00
|
|
|
SettingsListSwitch(
|
|
|
|
|
title: 'Use custom video overlay',
|
2023-04-29 11:34:28 -04:00
|
|
|
subtitle: const Text(
|
2023-10-22 18:38:32 -04:00
|
|
|
'Replaces Twitch\'s default web overlay with a mobile-friendly version.',
|
|
|
|
|
),
|
2022-03-26 01:52:08 -04:00
|
|
|
value: settingsStore.showOverlay,
|
2023-01-18 05:34:54 -05:00
|
|
|
onChanged: (newValue) => settingsStore.showOverlay = newValue,
|
2022-03-26 01:52:08 -04:00
|
|
|
),
|
2023-01-18 05:34:54 -05:00
|
|
|
SettingsListSwitch(
|
|
|
|
|
title: 'Long-press player to toggle overlay',
|
2023-04-29 11:34:28 -04:00
|
|
|
subtitle: const Text(
|
2023-10-22 18:38:32 -04:00
|
|
|
'Allows switching between Twitch\'s overlay and the custom overlay.',
|
|
|
|
|
),
|
2022-03-26 01:52:08 -04:00
|
|
|
value: settingsStore.toggleableOverlay,
|
2023-01-18 05:34:54 -05:00
|
|
|
onChanged: (newValue) => settingsStore.toggleableOverlay = newValue,
|
2022-03-26 01:52:08 -04:00
|
|
|
),
|
2023-01-18 05:34:54 -05:00
|
|
|
SettingsListSlider(
|
|
|
|
|
title: 'Custom overlay opacity',
|
2023-04-29 11:34:28 -04:00
|
|
|
trailing:
|
|
|
|
|
'${(settingsStore.overlayOpacity * 100).toStringAsFixed(0)}%',
|
|
|
|
|
subtitle:
|
|
|
|
|
'Adjusts the opacity (transparency) of the custom video overlay when active.',
|
2023-01-18 05:34:54 -05:00
|
|
|
value: settingsStore.overlayOpacity,
|
|
|
|
|
divisions: 10,
|
|
|
|
|
onChanged: (newValue) => settingsStore.overlayOpacity = newValue,
|
2022-06-04 02:21:57 -04:00
|
|
|
),
|
2022-03-26 01:52:08 -04:00
|
|
|
],
|
|
|
|
|
),
|
2021-12-28 22:52:29 -05:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|