From 064cd46816ca4c6f70272540343a17b36af379c5 Mon Sep 17 00:00:00 2001 From: Gold872 Date: Fri, 3 Nov 2023 17:14:23 -0400 Subject: [PATCH] Fixed changing tabs when widget dialog is open --- lib/pages/dashboard_page.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/pages/dashboard_page.dart b/lib/pages/dashboard_page.dart index 5615b6b3..592ace06 100644 --- a/lib/pages/dashboard_page.dart +++ b/lib/pages/dashboard_page.dart @@ -935,7 +935,7 @@ class _DashboardPageState extends State with WindowListener { tabViews: grids, ), AddWidgetDialog( - grid: grids[currentTabIndex], + grid: () => grids[currentTabIndex], visible: addWidgetDialogVisible, onNT4DragUpdate: (globalPosition, widget) { grids[currentTabIndex] @@ -1002,7 +1002,7 @@ class _DashboardPageState extends State with WindowListener { } class AddWidgetDialog extends StatelessWidget { - final DashboardGrid grid; + final DashboardGrid Function() grid; final bool visible; final Function(Offset globalPosition, DraggableNT4WidgetContainer widget)? @@ -1063,13 +1063,14 @@ class AddWidgetDialog extends StatelessWidget { NetworkTableTree( onDragUpdate: onNT4DragUpdate, onDragEnd: onNT4DragEnd, - widgetContainerBuilder: grid.createNT4WidgetContainer, + widgetContainerBuilder: (widgetContainer) => + grid().createNT4WidgetContainer(widgetContainer), ), ListView( children: [ LayoutDragTile( title: 'List Layout', - layoutBuilder: () => grid.createListLayout(), + layoutBuilder: () => grid().createListLayout(), onDragUpdate: onLayoutDragUpdate, onDragEnd: onLayoutDragEnd, ),