diff --git a/chameleonultragui/lib/gui/page/saved_cards.dart b/chameleonultragui/lib/gui/page/saved_cards.dart index 42a18455..501747ef 100644 --- a/chameleonultragui/lib/gui/page/saved_cards.dart +++ b/chameleonultragui/lib/gui/page/saved_cards.dart @@ -347,6 +347,11 @@ class SavedCardsPageState extends State { } }, style: ButtonStyle( + backgroundColor: MaterialStateProperty.resolveWith( + (Set states) { + return appState.sharedPreferencesProvider.getThemeComplementaryColor(); + }, + ), shape: MaterialStateProperty.all< RoundedRectangleBorder>( RoundedRectangleBorder( @@ -362,6 +367,7 @@ class SavedCardsPageState extends State { return Container( constraints: const BoxConstraints(minHeight: 80, maxHeight: 150), child: ElevatedButton( + onPressed: () { showDialog( context: context, @@ -458,6 +464,11 @@ class SavedCardsPageState extends State { ); }, style: ButtonStyle( + backgroundColor: MaterialStateProperty.resolveWith( + (Set states) { + return appState.sharedPreferencesProvider.getThemeComplementaryColor(); + }, + ), shape: MaterialStateProperty.all< RoundedRectangleBorder>( RoundedRectangleBorder( @@ -479,7 +490,9 @@ class SavedCardsPageState extends State { ), ], ), - Expanded( + Positioned(top: 0,right: 0, + child: SizedBox(child: ConstrainedBox(constraints: BoxConstraints(minHeight: 80,), + child: Expanded( flex: 1, child: Wrap( //mainAxisAlignment: MainAxisAlignment.end, @@ -514,6 +527,8 @@ class SavedCardsPageState extends State { ), ), + ), + ),), ], ), Positioned( diff --git a/chameleonultragui/lib/sharedprefsprovider.dart b/chameleonultragui/lib/sharedprefsprovider.dart index cde9d0e5..18450d99 100644 --- a/chameleonultragui/lib/sharedprefsprovider.dart +++ b/chameleonultragui/lib/sharedprefsprovider.dart @@ -217,6 +217,28 @@ class SharedPreferencesProvider extends ChangeNotifier { } } + Color getThemeComplementaryColor() { + final themeValue = _sharedPreferences.getInt('app_theme_color') ?? 0; + switch (themeValue) { + case 1: + return Color.fromARGB(30, 116, 58, 183); + case 2: + return Color.fromARGB(44, 62, 216, 243); + case 3: + return Color.fromARGB(50, 175, 76, 172); + case 4: + return Color.fromARGB(46, 130, 51, 196); + case 5: + return Color.fromARGB(48, 110, 116, 29); + case 6: + return Color.fromARGB(47, 188, 43, 201); + case 7: + return Color.fromARGB(44, 58, 104, 202); + default: + return Color.fromARGB(16, 202, 43, 43); + } + } + void setThemeColor(int color) { _sharedPreferences.setInt('app_theme_color', color); }