Basic Dark theme and option for theme in settings

This commit is contained in:
2023-05-24 21:53:18 +02:00
parent 9a1247de5f
commit 9aea09d582
4 changed files with 159 additions and 56 deletions

View File

@ -6,6 +6,7 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../data/accountModel.dart';
import '../../data/appTheme.dart';
import 'debug/debugOverview.dart';
class Settings extends StatefulWidget {
@ -72,6 +73,35 @@ class _SettingsState extends State<Settings> {
const Divider(),
Consumer<AppTheme>(
builder: (context, value, child) {
return ListTile(
leading: const Icon(Icons.dark_mode),
title: const Text("Farbgebung"),
trailing: DropdownButton<ThemeMode>(
value: value.getMode,
icon: const Icon(Icons.arrow_drop_down),
items: ThemeMode.values.map((e) => DropdownMenuItem<ThemeMode>(
value: e,
enabled: e != value.getMode,
child: Row(
children: [
Icon(AppTheme.getDisplayOptions(e).icon),
const SizedBox(width: 10),
Text(AppTheme.getDisplayOptions(e).displayName),
],
),
)).toList(),
onChanged: (e) {
Provider.of<AppTheme>(context, listen: false).setTheme(e ?? ThemeMode.system);
},
),
);
},
),
const Divider(),
ListTile(
leading: const Icon(Icons.info),
title: const Text("Informationen und Lizenzen"),