A whole bunch of changes
This commit is contained in:
parent
901ec678a3
commit
956231048e
122 changed files with 5442 additions and 914 deletions
47
lib/screens/ui_settings_screen.dart
Normal file
47
lib/screens/ui_settings_screen.dart
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../services/app_state.dart';
|
||||
|
||||
/// "UI" settings submenu, reached from [SettingsScreen] — currently just
|
||||
/// Appearance (theme), but its own screen so more display-related settings
|
||||
/// have somewhere to go without crowding the Settings landing page.
|
||||
class UiSettingsScreen extends StatelessWidget {
|
||||
const UiSettingsScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final appState = context.watch<AppState>();
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('UI')),
|
||||
body: ListView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
children: [
|
||||
Card(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Appearance', style: Theme.of(context).textTheme.titleMedium),
|
||||
const SizedBox(height: 12),
|
||||
SegmentedButton<ThemeMode>(
|
||||
segments: const [
|
||||
ButtonSegment(value: ThemeMode.system, label: Text('System')),
|
||||
ButtonSegment(value: ThemeMode.light, label: Text('Light')),
|
||||
ButtonSegment(value: ThemeMode.dark, label: Text('Dark')),
|
||||
],
|
||||
selected: {appState.themeMode},
|
||||
onSelectionChanged: (selection) =>
|
||||
context.read<AppState>().setThemeMode(selection.first),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue