Look at all these colors!🌈

This commit is contained in:
Gregory Velichko
2024-04-20 18:24:08 +03:00
parent fb206aee84
commit ed732cfad2
7 changed files with 152 additions and 37 deletions

View File

@@ -17,11 +17,10 @@ import 'package:shared_storage/shared_storage.dart' as saf;
String obtainiumTempId = 'imranr98_obtainium_${GitHub().hosts[0]}';
String obtainiumId = 'dev.imranr.obtainium';
String obtainiumUrl = 'https://github.com/ImranR98/Obtainium';
Color obtainiumThemeColor = const Color(0xFF6438B5);
enum ThemeSettings { light, dark, system }
enum ColourSettings { basic, materialYou }
enum SortColumnSettings { added, nameAuthor, authorName, releaseDate }
enum SortOrderSettings { ascending, descending }
@@ -68,13 +67,23 @@ class SettingsProvider with ChangeNotifier {
notifyListeners();
}
ColourSettings get colour {
return ColourSettings
.values[prefs?.getInt('colour') ?? ColourSettings.basic.index];
Color get themeColor {
int? colorCode = prefs?.getInt('themeColor');
return (colorCode != null) ?
Color(colorCode) : obtainiumThemeColor;
}
set colour(ColourSettings t) {
prefs?.setInt('colour', t.index);
set themeColor(Color themeColor) {
prefs?.setInt('themeColor', themeColor.value);
notifyListeners();
}
bool get useMaterialYou {
return prefs?.getBool('useMaterialYou') ?? false;
}
set useMaterialYou(bool useMaterialYou) {
prefs?.setBool('useMaterialYou', useMaterialYou);
notifyListeners();
}