Settings page and theme selection

This commit is contained in:
Yegor Vialov
2020-04-11 16:09:35 +00:00
parent 68d14bd13d
commit 5f23e108a1
9 changed files with 532 additions and 328 deletions

View File

@ -1,10 +1,8 @@
part of '../main.dart';
class HAClientTheme {
enum AppTheme {darkTheme, defaultTheme, haTheme}
static const DEFAULT = 0;
static const DARK = 1;
static const HOMEASSISTANT = 2;
class HAClientTheme {
static const TextTheme textTheme = TextTheme(
display1: TextStyle(fontSize: 34, fontWeight: FontWeight.normal),
@ -80,6 +78,22 @@ class HAClientTheme {
HAClientTheme._internal();
ThemeData getThemeData(AppTheme theme) {
switch (theme) {
case AppTheme.darkTheme:
return darkTheme;
break;
case AppTheme.defaultTheme:
return lightTheme;
break;
case AppTheme.haTheme:
return lightTheme;
break;
default:
return lightTheme;
}
}
final ThemeData lightTheme = ThemeData.from(
colorScheme: ColorScheme(
primary: Color.fromRGBO(112, 154, 193, 1),