Files
game-tracker/lib/presentation/views/main_menu/settings_subpages/theme_view.dart

81 lines
2.3 KiB
Dart

import 'package:flutter/material.dart';
import 'package:game_tracker/core/custom_theme.dart';
class ThemeView extends StatefulWidget {
const ThemeView({super.key});
@override
State<ThemeView> createState() => _ThemeViewState();
}
enum themeOptions {
systemDefault('Systemstandard'),
dark('Dunkel'),
light('Hell');
final String label;
const themeOptions(this.label);
}
class _ThemeViewState extends State<ThemeView> {
themeOptions? _selectedTheme = themeOptions.systemDefault;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Design'), titleTextStyle: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), centerTitle: true, backgroundColor: CustomTheme.backgroundColor),
backgroundColor: CustomTheme.backgroundColor,
body: Column(
children: [
ListTile(
title: Text(themeOptions.systemDefault.label),
onTap: () {
setState(() {
_selectedTheme = themeOptions.systemDefault;
});
},
leading: Radio(
value: themeOptions.systemDefault,
groupValue: _selectedTheme,
onChanged: (value) {
setState(() {
_selectedTheme = themeOptions.systemDefault;
});
},
),
),
ListTile(
title: Text(themeOptions.dark.label),
onTap: () {
setState(() {
_selectedTheme = themeOptions.dark;
});
},
leading: Radio(
value: themeOptions.dark,
groupValue: _selectedTheme,
onChanged: (value) {setState(() {
_selectedTheme = themeOptions.dark;
});},
),
),
ListTile(
title: Text(themeOptions.light.label),
onTap: () {
setState(() {
_selectedTheme = themeOptions.light;
});
},
leading: Radio(
value: themeOptions.light,
groupValue: _selectedTheme,
onChanged: (value) {setState(() {
_selectedTheme = themeOptions.light;
});},
),
)
],
),
);
}
}