Fix dashboard switching issues
This commit is contained in:
parent
82d7aeba02
commit
513bf85cae
@ -90,7 +90,7 @@ class CardWidget extends StatelessWidget {
|
|||||||
return Row(
|
return Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: children,
|
children: children,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,6 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver, Ticker
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _quickLoad({bool uiOnly: false}) {
|
void _quickLoad({bool uiOnly: false}) {
|
||||||
_bottomInfoBarController.hideBottomBar();
|
|
||||||
_bottomInfoBarController.showInfoBottomBar(progress: true,);
|
_bottomInfoBarController.showInfoBottomBar(progress: true,);
|
||||||
ConnectionManager().init(loadSettings: false, forceReconnect: false).then((_){
|
ConnectionManager().init(loadSettings: false, forceReconnect: false).then((_){
|
||||||
_fetchData(useCache: false, uiOnly: uiOnly);
|
_fetchData(useCache: false, uiOnly: uiOnly);
|
||||||
@ -127,7 +126,10 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver, Ticker
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
await HomeAssistant().fetchData(uiOnly).then((_) {
|
await HomeAssistant().fetchData(uiOnly).then((_) {
|
||||||
|
setState((){
|
||||||
_bottomInfoBarController.hideBottomBar();
|
_bottomInfoBarController.hideBottomBar();
|
||||||
|
});
|
||||||
|
HomeAssistant().saveCache();
|
||||||
}).catchError((e) {
|
}).catchError((e) {
|
||||||
if (e is HAError) {
|
if (e is HAError) {
|
||||||
_setErrorState(e);
|
_setErrorState(e);
|
||||||
@ -144,7 +146,7 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver, Ticker
|
|||||||
if (state == AppLifecycleState.resumed && ConnectionManager().settingsLoaded && !_preventAppRefresh) {
|
if (state == AppLifecycleState.resumed && ConnectionManager().settingsLoaded && !_preventAppRefresh) {
|
||||||
_quickLoad();
|
_quickLoad();
|
||||||
} else if (state == AppLifecycleState.paused && ConnectionManager().settingsLoaded && !_preventAppRefresh) {
|
} else if (state == AppLifecycleState.paused && ConnectionManager().settingsLoaded && !_preventAppRefresh) {
|
||||||
HomeAssistant().saveCache();
|
//HomeAssistant().saveCache();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,13 +61,7 @@ class HomeAssistantUI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<Widget> _buildViews(BuildContext context) {
|
List<Widget> _buildViews(BuildContext context) {
|
||||||
List<Widget> result = [];
|
return views.map((view) => view.build(context)).toList();
|
||||||
views.forEach((view) {
|
|
||||||
result.add(
|
|
||||||
view.build(context)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear() {
|
void clear() {
|
||||||
|
Reference in New Issue
Block a user