From 1fd40af4dc5455f6beed27a0e4800bcfd5611043 Mon Sep 17 00:00:00 2001 From: Gold872 Date: Mon, 11 Dec 2023 15:39:45 -0500 Subject: [PATCH] Fixed default tabs not showing on startup --- lib/pages/dashboard_page.dart | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/lib/pages/dashboard_page.dart b/lib/pages/dashboard_page.dart index a224f7c2..f5ad62cb 100644 --- a/lib/pages/dashboard_page.dart +++ b/lib/pages/dashboard_page.dart @@ -504,21 +504,23 @@ class _DashboardPageState extends State with WindowListener { void createDefaultTabs() { if (tabData.isEmpty || grids.isEmpty) { logger.info('Creating default Teleoperated and Autonomous tabs'); - tabData.addAll([ - TabData(name: 'Teleoperated'), - TabData(name: 'Autonomous'), - ]); + setState(() { + tabData.addAll([ + TabData(name: 'Teleoperated'), + TabData(name: 'Autonomous'), + ]); - grids.addAll([ - DashboardGrid( - key: GlobalKey(), - onAddWidgetPressed: displayAddWidgetDialog, - ), - DashboardGrid( - key: GlobalKey(), - onAddWidgetPressed: displayAddWidgetDialog, - ), - ]); + grids.addAll([ + DashboardGrid( + key: GlobalKey(), + onAddWidgetPressed: displayAddWidgetDialog, + ), + DashboardGrid( + key: GlobalKey(), + onAddWidgetPressed: displayAddWidgetDialog, + ), + ]); + }); } }