Skip to content

Commit ccd1a48

Browse files
committed
WIP Refactor themes
1 parent 2b04b87 commit ccd1a48

File tree

15 files changed

+385
-91
lines changed

15 files changed

+385
-91
lines changed

lib/bloc/theme/app_theme.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
enum AppTheme {
22
light,
33
dark,
4-
yellow,
4+
lightGold,
5+
darkGold,
6+
lightMint,
7+
darkMint,
58
system,
69
experimental,
710
}

lib/bloc/theme/theme_cubit.dart

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ import 'package:flutter_bloc_app_template/repository/theme_repository.dart';
77
final Map<AppTheme, ThemeData> themeData = {
88
AppTheme.system: Style.light,
99
AppTheme.light: Style.light,
10+
AppTheme.lightGold: Style.lightGoldTheme,
11+
AppTheme.lightMint: Style.lightMintTheme,
1012
AppTheme.dark: Style.dark,
11-
AppTheme.yellow: Style.yellow,
13+
AppTheme.darkGold: Style.darkGoldTheme,
14+
AppTheme.darkMint: Style.darkMintTheme,
1215
AppTheme.experimental: Style.experimental,
1316
};
1417

@@ -39,9 +42,12 @@ class ThemeCubit extends Cubit<AppTheme> {
3942
switch (state) {
4043
case AppTheme.experimental:
4144
case AppTheme.light:
42-
case AppTheme.yellow:
45+
case AppTheme.lightGold:
46+
case AppTheme.lightMint:
4347
return ThemeMode.light;
4448
case AppTheme.dark:
49+
case AppTheme.darkGold:
50+
case AppTheme.darkMint:
4551
return ThemeMode.dark;
4652
default:
4753
return ThemeMode.system;
@@ -53,10 +59,16 @@ class ThemeCubit extends Cubit<AppTheme> {
5359
switch (state) {
5460
case AppTheme.light:
5561
return themeData[AppTheme.light] ?? Style.light;
62+
case AppTheme.lightGold:
63+
return themeData[AppTheme.lightGold] ?? Style.light;
64+
case AppTheme.lightMint:
65+
return themeData[AppTheme.lightMint] ?? Style.light;
5666
case AppTheme.dark:
5767
return themeData[AppTheme.dark] ?? Style.dark;
58-
case AppTheme.yellow:
59-
return themeData[AppTheme.yellow] ?? Style.light;
68+
case AppTheme.darkGold:
69+
return themeData[AppTheme.darkGold] ?? Style.dark;
70+
case AppTheme.darkMint:
71+
return themeData[AppTheme.darkMint] ?? Style.dark;
6072
case AppTheme.system:
6173
return themeData[AppTheme.system] ?? Style.light;
6274
case AppTheme.experimental:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import 'package:flutter/widgets.dart';
2+
3+
class ContactsScreen extends StatelessWidget {
4+
const ContactsScreen({super.key});
5+
6+
@override
7+
Widget build(BuildContext context) {
8+
return const Placeholder();
9+
}
10+
}

lib/features/main/main_screen.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ class MainScreenState extends State<MainScreen> {
3636
],
3737
),
3838
bottomNavigationBar: NavigationBar(
39+
//backgroundColor: Color(0xFFF2F4F7),
40+
//surfaceTintColor: Colors.white,
41+
//indicatorColor: Color(0xFFD0E9FF),
3942
destinations: destinations,
4043
selectedIndex: currentIndex,
4144
onDestinationSelected: onSelected,

lib/features/settings/settings_screen.dart

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,27 @@ class SettingsScreen extends StatelessWidget {
4040
onChanged: (value) => updateTheme(context, value),
4141
),
4242
ThemeDialogCell<AppTheme>(
43-
title: S.of(context).yellowThemeTitle,
43+
title: S.of(context).lightGoldThemeTitle,
4444
groupValue: state,
45-
value: AppTheme.yellow,
45+
value: AppTheme.lightGold,
46+
onChanged: (value) => updateTheme(context, value),
47+
),
48+
ThemeDialogCell<AppTheme>(
49+
title: S.of(context).lightMintThemeTitle,
50+
groupValue: state,
51+
value: AppTheme.lightMint,
52+
onChanged: (value) => updateTheme(context, value),
53+
),
54+
ThemeDialogCell<AppTheme>(
55+
title: S.of(context).darkGoldThemeTitle,
56+
groupValue: state,
57+
value: AppTheme.darkGold,
58+
onChanged: (value) => updateTheme(context, value),
59+
),
60+
ThemeDialogCell<AppTheme>(
61+
title: S.of(context).darkMintThemeTitle,
62+
groupValue: state,
63+
value: AppTheme.darkMint,
4664
onChanged: (value) => updateTheme(context, value),
4765
),
4866
ThemeDialogCell<AppTheme>(

lib/features/view.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export 'contacts/contacts_screen.dart';
12
export 'email_list/email_list_screen.dart';
23
export 'email_list/view/email_list_item.dart';
34
export 'email_list/view/email_list_view.dart';

lib/generated/intl/messages_de.dart

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ class MessageLookup extends MessageLookupByLibrary {
3030
MessageLookupByLibrary.simpleMessage("BorderRadius"),
3131
"borderSideButtonTitle":
3232
MessageLookupByLibrary.simpleMessage("BorderSide"),
33+
"darkGoldThemeTitle":
34+
MessageLookupByLibrary.simpleMessage("Dunkles Gold-Thema"),
35+
"darkMintThemeTitle":
36+
MessageLookupByLibrary.simpleMessage("Dunkles Minz-Thema"),
3337
"darkThemeTitle": MessageLookupByLibrary.simpleMessage("Dunkles Thema"),
3438
"disabledButtonTitle": MessageLookupByLibrary.simpleMessage("Disabled"),
3539
"disabledRoundedButtonTitle":
@@ -39,15 +43,17 @@ class MessageLookup extends MessageLookupByLibrary {
3943
"emptyList": MessageLookupByLibrary.simpleMessage("Leere Liste"),
4044
"enabledButtonTitle": MessageLookupByLibrary.simpleMessage("Enabled"),
4145
"error": MessageLookupByLibrary.simpleMessage("Fehler"),
42-
"experimentalThemeTitle":
43-
MessageLookupByLibrary.simpleMessage("Experimental Theme"),
4446
"iconAndPaddingButtonTitle":
4547
MessageLookupByLibrary.simpleMessage("With Icon Padding"),
4648
"iconButtonTitle": MessageLookupByLibrary.simpleMessage("With Icon"),
4749
"itemDetailsTitle":
4850
MessageLookupByLibrary.simpleMessage("Artikel Details"),
4951
"itemTitle": m0,
5052
"itemsTitle": MessageLookupByLibrary.simpleMessage("Musterartikel"),
53+
"lightGoldThemeTitle":
54+
MessageLookupByLibrary.simpleMessage("Helles Gold-Thema"),
55+
"lightMintThemeTitle":
56+
MessageLookupByLibrary.simpleMessage("Helles Minz-Thema"),
5157
"lightThemeTitle": MessageLookupByLibrary.simpleMessage("Licht-Thema"),
5258
"messagesTitle": MessageLookupByLibrary.simpleMessage("Nachrichten"),
5359
"newsScreen": MessageLookupByLibrary.simpleMessage("News"),
@@ -58,7 +64,6 @@ class MessageLookup extends MessageLookupByLibrary {
5864
"tabSettings": MessageLookupByLibrary.simpleMessage("Settings"),
5965
"themeTitle": MessageLookupByLibrary.simpleMessage("Thema"),
6066
"transparentButtonTitle":
61-
MessageLookupByLibrary.simpleMessage("Transparent"),
62-
"yellowThemeTitle": MessageLookupByLibrary.simpleMessage("Gelbes Thema")
67+
MessageLookupByLibrary.simpleMessage("Transparent")
6368
};
6469
}

lib/generated/intl/messages_en.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class MessageLookup extends MessageLookupByLibrary {
3030
MessageLookupByLibrary.simpleMessage("BorderRadius"),
3131
"borderSideButtonTitle":
3232
MessageLookupByLibrary.simpleMessage("BorderSide"),
33+
"darkGoldThemeTitle": MessageLookupByLibrary.simpleMessage("Dark Gold"),
34+
"darkMintThemeTitle": MessageLookupByLibrary.simpleMessage("Dark Mint"),
3335
"darkThemeTitle": MessageLookupByLibrary.simpleMessage("Dark Theme"),
3436
"disabledButtonTitle": MessageLookupByLibrary.simpleMessage("Disabled"),
3537
"disabledRoundedButtonTitle":
@@ -48,6 +50,10 @@ class MessageLookup extends MessageLookupByLibrary {
4850
MessageLookupByLibrary.simpleMessage("Item Details"),
4951
"itemTitle": m0,
5052
"itemsTitle": MessageLookupByLibrary.simpleMessage("Sample Items"),
53+
"lightGoldThemeTitle":
54+
MessageLookupByLibrary.simpleMessage("Light Gold"),
55+
"lightMintThemeTitle":
56+
MessageLookupByLibrary.simpleMessage("Light Mint"),
5157
"lightThemeTitle": MessageLookupByLibrary.simpleMessage("Light Theme"),
5258
"messagesTitle": MessageLookupByLibrary.simpleMessage("Messages"),
5359
"newsScreen": MessageLookupByLibrary.simpleMessage("News"),
@@ -58,7 +64,6 @@ class MessageLookup extends MessageLookupByLibrary {
5864
"tabSettings": MessageLookupByLibrary.simpleMessage("Settings"),
5965
"themeTitle": MessageLookupByLibrary.simpleMessage("Theme"),
6066
"transparentButtonTitle":
61-
MessageLookupByLibrary.simpleMessage("Transparent"),
62-
"yellowThemeTitle": MessageLookupByLibrary.simpleMessage("Yellow Theme")
67+
MessageLookupByLibrary.simpleMessage("Transparent")
6368
};
6469
}

lib/generated/l10n.dart

Lines changed: 34 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/l10n/intl_de.arb

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,19 @@
2727
"@lightThemeTitle": {},
2828
"darkThemeTitle": "Dunkles Thema",
2929
"@darkThemeTitle": {},
30-
"yellowThemeTitle": "Gelbes Thema",
31-
"@yellowThemeTitle": {},
32-
"experimentalThemeTitle": "Experimental Theme",
33-
"@experimentalThemeTitle": {},
30+
31+
"lightGoldThemeTitle": "Helles Gold-Thema",
32+
"@lightGoldThemeTitle": {},
33+
34+
"darkGoldThemeTitle": "Dunkles Gold-Thema",
35+
"@darkGoldThemeTitle": {},
36+
37+
"lightMintThemeTitle": "Helles Minz-Thema",
38+
"@lightMintThemeTitle": {},
39+
40+
"darkMintThemeTitle": "Dunkles Minz-Thema",
41+
"@darkMintThemeTitle": {},
42+
3443
"itemDetailsTitle": "Artikel Details",
3544
"@itemDetailsTitle": {
3645
"description": "Der Titel des Bildschirms Artikeldetails"

0 commit comments

Comments
 (0)