From 524d195800c0bb991ddee47754c22a6c76820ea9 Mon Sep 17 00:00:00 2001 From: Yegor Vialov Date: Mon, 6 Apr 2020 20:03:41 +0000 Subject: [PATCH] WIP #102 Colors from theme --- lib/managers/theme_manager.dart | 4 ++-- lib/pages/main/main.page.dart | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/managers/theme_manager.dart b/lib/managers/theme_manager.dart index c390ce8..ae51101 100644 --- a/lib/managers/theme_manager.dart +++ b/lib/managers/theme_manager.dart @@ -40,7 +40,6 @@ class HAClientTheme { EntityState.open, EntityState.cleaning, EntityState.returning, - "heat", "cool", EntityState.alarm_arming, EntityState.alarm_disarming, @@ -58,6 +57,7 @@ class HAClientTheme { EntityState.alarm_armed_home, EntityState.alarm_armed_night, EntityState.alarm_triggered, + "heat", ]; static const defaultStateColor = Color.fromRGBO(68, 115, 158, 1.0); @@ -82,7 +82,7 @@ class HAClientTheme { primaryVariant: Color.fromRGBO(68, 115, 158, 1), secondary: Color.fromRGBO(253, 216, 53, 1), secondaryVariant: Color.fromRGBO(222, 181, 2, 1), - background: Colors.white, + background: Color.fromRGBO(250, 250, 250, 1), surface: Colors.white, error: Colors.red, onPrimary: Colors.white, diff --git a/lib/pages/main/main.page.dart b/lib/pages/main/main.page.dart index 83d23ef..a86d706 100644 --- a/lib/pages/main/main.page.dart +++ b/lib/pages/main/main.page.dart @@ -504,13 +504,13 @@ class _MainPageState extends State with WidgetsBindingObserver, Ticker bool _showBottomBar = false; String _bottomBarText; bool _bottomBarProgress; - Color _bottomBarColor; + bool _bottomBarErrorColor; Timer _bottomBarTimer; void _showInfoBottomBar({String message, bool progress: false, Duration duration}) { _bottomBarTimer?.cancel(); _bottomBarAction = Container(height: 0.0, width: 0.0,); - _bottomBarColor = Colors.grey.shade50; + _bottomBarErrorColor = false; setState(() { _bottomBarText = message; _bottomBarProgress = progress; @@ -524,10 +524,10 @@ class _MainPageState extends State with WidgetsBindingObserver, Ticker } void _showErrorBottomBar(HAError error) { - TextStyle textStyle = Theme.of(context).textTheme.subhead.copyWith( - color: Colors.blue + TextStyle textStyle = Theme.of(context).textTheme.button.copyWith( + decoration: TextDecoration.underline ); - _bottomBarColor = Colors.red.shade100; + _bottomBarErrorColor = true; List actions = []; error.actions.forEach((HAErrorAction action) { switch (action.type) { @@ -831,7 +831,7 @@ class _MainPageState extends State with WidgetsBindingObserver, Ticker } if (bottomBarChildren.isNotEmpty) { bottomBar = Container( - color: _bottomBarColor, + color: _bottomBarErrorColor ? Theme.of(context).errorColor : Theme.of(context).primaryColorLight, child: Row( mainAxisSize: MainAxisSize.max, children: [