frosty/lib/screens/settings/video_settings.dart

44 lines
1.6 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/widgets/section_header.dart';
class VideoSettings extends StatelessWidget {
final SettingsStore settingsStore;
const VideoSettings({Key? key, required this.settingsStore}) : super(key: key);
@override
Widget build(BuildContext context) {
return Observer(
builder: (context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SectionHeader('Video'),
SwitchListTile.adaptive(
title: const Text('Show video'),
value: settingsStore.showVideo,
onChanged: (newValue) => settingsStore.showVideo = newValue,
),
SwitchListTile.adaptive(
isThreeLine: true,
title: const Text('Use custom video overlay'),
subtitle: const Text('Replaces the default video overlay with a mobile-friendly version.'),
value: settingsStore.showOverlay,
onChanged: settingsStore.showVideo ? (newValue) => settingsStore.showOverlay = newValue : null,
),
if (Platform.isIOS)
SwitchListTile.adaptive(
title: const Text('Picture-in-picture button'),
value: settingsStore.pictureInPicture,
onChanged: settingsStore.showOverlay ? (newValue) => settingsStore.pictureInPicture = newValue : null,
),
],
);
},
);
}
}