From f7a4fcecdcda24894e1328adc7b6234885d9d015 Mon Sep 17 00:00:00 2001 From: Willian <47341070+wjrcode@users.noreply.github.com> Date: Wed, 21 Sep 2022 17:16:17 -0300 Subject: [PATCH] dialog --- lib/components/navigation/menu.dart | 46 +++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/lib/components/navigation/menu.dart b/lib/components/navigation/menu.dart index f6dd2aa..545fdca 100644 --- a/lib/components/navigation/menu.dart +++ b/lib/components/navigation/menu.dart @@ -616,6 +616,52 @@ Future veipls({ ); } +Future showTimePicker({ + required BuildContext context, + required TimeOfDay initialTime, + TransitionBuilder? builder, + bool useRootNavigator = true, + TimePickerEntryMode initialEntryMode = TimePickerEntryMode.dial, + String? cancelText, + String? confirmText, + String? helpText, + String? errorInvalidText, + String? hourLabelText, + String? minuteLabelText, + RouteSettings? routeSettings, + EntryModeChangeCallback? onEntryModeChanged, + Offset? anchorPoint, +}) async { + assert(context != null); + assert(initialTime != null); + assert(useRootNavigator != null); + assert(initialEntryMode != null); + assert(debugCheckHasMaterialLocalizations(context)); + + final Widget dialog = TimePickerDialog( + initialTime: initialTime, + initialEntryMode: initialEntryMode, + cancelText: cancelText, + confirmText: confirmText, + helpText: helpText, + errorInvalidText: errorInvalidText, + hourLabelText: hourLabelText, + minuteLabelText: minuteLabelText, + onEntryModeChanged: onEntryModeChanged, + ); + return showDialog( + barrierDismissible: false, + barrierColor: Colors.white.withOpacity(0), + context: context, + useRootNavigator: useRootNavigator, + builder: (BuildContext context) { + return builder == null ? dialog : builder(context, dialog); + }, + routeSettings: routeSettings, + anchorPoint: anchorPoint, + ); +} + const List list = ['baixa', 'média', 'alta']; class DropdownButtonExample extends StatefulWidget {