diff --git a/lib/src/widgets/helpers.dart b/lib/src/widgets/helpers.dart index 2664ce5..0d8e4f3 100644 --- a/lib/src/widgets/helpers.dart +++ b/lib/src/widgets/helpers.dart @@ -16,3 +16,14 @@ double sideBarSizeProperties(BuildContext context) { final factor = isLargeScreen(context) ? 0.5 : 1; return screenWidth * factor; } + +Future showPopup({ + required BuildContext context, + required WidgetBuilder builder, +}) async { + return showDialog( + context: context, + builder: builder, + useRootNavigator: false, + ); +} diff --git a/lib/src/widgets/property_widgets/border_radius_property.dart b/lib/src/widgets/property_widgets/border_radius_property.dart index ea03e6d..e5c0f12 100644 --- a/lib/src/widgets/property_widgets/border_radius_property.dart +++ b/lib/src/widgets/property_widgets/border_radius_property.dart @@ -90,7 +90,7 @@ class _BorderRadiusPropertyState extends State { } } - Future show() => showDialog( + Future show() => showPopup( context: context, builder: (_) => FourIntegerForm( _confirmEdition, diff --git a/lib/src/widgets/property_widgets/color_property.dart b/lib/src/widgets/property_widgets/color_property.dart index e035b6c..8896f84 100644 --- a/lib/src/widgets/property_widgets/color_property.dart +++ b/lib/src/widgets/property_widgets/color_property.dart @@ -1,4 +1,5 @@ import 'package:dashbook/dashbook.dart'; +import 'package:dashbook/src/widgets/helpers.dart'; import 'package:dashbook/src/widgets/property_widgets/widgets/property_dialog.dart'; import 'package:flutter/material.dart'; import 'package:flutter_colorpicker/flutter_colorpicker.dart'; @@ -29,7 +30,7 @@ class ColorPropertyState extends State { } // raise the [showDialog] widget - Future show() => showDialog( + Future show() => showPopup( context: context, builder: (_) => PropertyDialog( title: 'Pick a color!', diff --git a/lib/src/widgets/property_widgets/edge_insets_property.dart b/lib/src/widgets/property_widgets/edge_insets_property.dart index 4be89f5..689ebd6 100644 --- a/lib/src/widgets/property_widgets/edge_insets_property.dart +++ b/lib/src/widgets/property_widgets/edge_insets_property.dart @@ -83,7 +83,7 @@ class _EdgeInsetsPropertyState extends State { } } - Future show() => showDialog( + Future show() => showPopup( context: context, builder: (_) => FourIntegerForm( _confirmEdition, diff --git a/lib/src/widgets/widget.dart b/lib/src/widgets/widget.dart index c237fe1..cf4db37 100644 --- a/lib/src/widgets/widget.dart +++ b/lib/src/widgets/widget.dart @@ -316,7 +316,7 @@ class _DashbookState extends State { tooltip: 'Instructions', icon: Icons.info, onClick: () { - showDialog( + showPopup( context: context, builder: (_) { return InstructionsDialog( @@ -347,9 +347,8 @@ class _DashbookState extends State { tooltip: 'Choose theme', icon: Icons.palette, onClick: () { - showDialog( + showPopup( context: context, - useRootNavigator: false, builder: (_) => AlertDialog( title: const Text('Theme chooser'), content: DropdownButton(