WIP: App settings refactoring

This commit is contained in:
Yegor Vialov
2020-05-13 12:46:25 +00:00
parent a20dfaf05e
commit 5683ab5158
18 changed files with 129 additions and 106 deletions

View File

@ -187,12 +187,11 @@ void main() async {
};
WidgetsFlutterBinding.ensureInitialized();
SharedPreferences prefs = await SharedPreferences.getInstance();
AppTheme theme = AppTheme.values[prefs.getInt('app-theme') ?? AppTheme.defaultTheme.index];
AppSettings().loadAppTheme();
runZoned(() {
runApp(new HAClientApp(
theme: theme,
theme: AppSettings().appTheme,
));
}, onError: (error, stack) {
_reportError(error, stack);
@ -287,7 +286,7 @@ class _HAClientAppState extends State<HAClientApp> {
"/quick-start": (context) => QuickStartPage(),
"/haclient_zha": (context) => ZhaPage(),
"/auth": (context) => new standaloneWebview.WebviewScaffold(
url: "${ConnectionManager().oauthUrl}",
url: "${AppSettings().oauthUrl}",
appBar: new AppBar(
leading: IconButton(
icon: Icon(Icons.help),