Skip to content

Commit

Permalink
Fixed default tabs not showing on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold872 committed Dec 11, 2023
1 parent 458a85d commit 1fd40af
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions lib/pages/dashboard_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -504,21 +504,23 @@ class _DashboardPageState extends State<DashboardPage> 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,
),
]);
});
}
}

Expand Down

0 comments on commit 1fd40af

Please sign in to comment.