diff --git a/lib/widgets/dashboard_grid.dart b/lib/widgets/dashboard_grid.dart index 17927e1..ac81820 100644 --- a/lib/widgets/dashboard_grid.dart +++ b/lib/widgets/dashboard_grid.dart @@ -1,4 +1,5 @@ import 'package:contextmenu/contextmenu.dart'; +import 'package:dot_cast/dot_cast.dart'; import 'package:elastic_dashboard/services/globals.dart'; import 'package:elastic_dashboard/services/nt4_connection.dart'; import 'package:elastic_dashboard/widgets/draggable_containers/draggable_layout_container.dart'; @@ -229,6 +230,8 @@ class DashboardGrid extends StatelessWidget { widget.validLocation = true; widget.dispose(); + widget.refresh(); + widget.tryCast()?.refreshChild(); } void onWidgetDragCancel(DraggableWidgetContainer widget) { diff --git a/lib/widgets/draggable_containers/draggable_nt4_widget_container.dart b/lib/widgets/draggable_containers/draggable_nt4_widget_container.dart index 9895fae..3242715 100644 --- a/lib/widgets/draggable_containers/draggable_nt4_widget_container.dart +++ b/lib/widgets/draggable_containers/draggable_nt4_widget_container.dart @@ -158,6 +158,10 @@ class DraggableNT4WidgetContainer extends DraggableWidgetContainer { onJsonLoadingWarning: onJsonLoadingWarning); } + void refreshChild() { + child?.refresh(); + } + @override void dispose({bool deleting = false}) { super.dispose(deleting: deleting); @@ -534,7 +538,10 @@ class DraggableNT4WidgetContainer extends DraggableWidgetContainer { width: draggablePositionRect.width, height: draggablePositionRect.height, opacity: 0.80, - child: child, + child: ChangeNotifierProvider( + create: (context) => NT4WidgetNotifier(), + child: child, + ), ); }