import 'package:e_receipt_mobile/presentation/settings/theme_mode_provider.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; class SettingsScreen extends ConsumerWidget { const SettingsScreen({super.key}); @override Widget build(BuildContext context, WidgetRef ref) { final selectedMode = ref.watch(appThemeModeProvider); return Scaffold( appBar: AppBar( title: const Text('Settings'), centerTitle: true, ), body: ListView( padding: const EdgeInsets.all(16), children: [ Text( 'Theme', style: Theme.of(context).textTheme.titleLarge, ), const SizedBox(height: 8), Card( child: Column( children: [ RadioListTile( title: const Text('Light'), value: ThemeMode.light, groupValue: selectedMode, onChanged: (value) { if (value != null) { ref.read(appThemeModeProvider.notifier).state = value; } }, ), RadioListTile( title: const Text('Dark'), value: ThemeMode.dark, groupValue: selectedMode, onChanged: (value) { if (value != null) { ref.read(appThemeModeProvider.notifier).state = value; } }, ), RadioListTile( title: const Text('System'), value: ThemeMode.system, groupValue: selectedMode, onChanged: (value) { if (value != null) { ref.read(appThemeModeProvider.notifier).state = value; } }, ), ], ), ), ], ), ); } }