remove accentColor config
This commit is contained in:
parent
596e8f4e53
commit
da107a7ad7
|
@ -39,7 +39,6 @@ class MyApp extends StatelessWidget {
|
|||
themeMode: ctx.watch<ConfigStore>().theme,
|
||||
darkTheme: ThemeData.dark(),
|
||||
theme: ThemeData(
|
||||
primarySwatch: ctx.watch<ConfigStore>().accentColor,
|
||||
visualDensity: VisualDensity.adaptivePlatformDensity,
|
||||
),
|
||||
home: MyHomePage(title: 'Flutter hello world'),
|
||||
|
|
|
@ -69,11 +69,6 @@ class _AppearanceConfig extends StatelessWidget {
|
|||
ctx.read<ConfigStore>().theme = selected;
|
||||
},
|
||||
),
|
||||
Text(
|
||||
'Accent color',
|
||||
style: theme.textTheme.headline6,
|
||||
),
|
||||
// TODO: add accent color picking
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
@ -25,7 +25,6 @@ abstract class _ConfigStore with Store {
|
|||
var prefs = await SharedPreferences.getInstance();
|
||||
// load saved settings or create defaults
|
||||
theme = _themeModeFromString(prefs.getString('theme') ?? 'system');
|
||||
// TODO: persistently save and load accent color
|
||||
}
|
||||
|
||||
void save() async {
|
||||
|
@ -37,8 +36,7 @@ abstract class _ConfigStore with Store {
|
|||
@observable
|
||||
ThemeMode theme;
|
||||
|
||||
@observable
|
||||
MaterialColor accentColor;
|
||||
// TODO: add amoledDarkMode switch
|
||||
}
|
||||
|
||||
ThemeMode _themeModeFromString(String theme) =>
|
||||
|
|
|
@ -24,26 +24,10 @@ mixin _$ConfigStore on _ConfigStore, Store {
|
|||
});
|
||||
}
|
||||
|
||||
final _$accentColorAtom = Atom(name: '_ConfigStore.accentColor');
|
||||
|
||||
@override
|
||||
MaterialColor get accentColor {
|
||||
_$accentColorAtom.reportRead();
|
||||
return super.accentColor;
|
||||
}
|
||||
|
||||
@override
|
||||
set accentColor(MaterialColor value) {
|
||||
_$accentColorAtom.reportWrite(value, super.accentColor, () {
|
||||
super.accentColor = value;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return '''
|
||||
theme: ${theme},
|
||||
accentColor: ${accentColor}
|
||||
theme: ${theme}
|
||||
''';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue