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