Skip to content

Commit

Permalink
dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
wjrcode committed Sep 21, 2022
1 parent ad1248a commit f7a4fce
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions lib/components/navigation/menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,52 @@ Future<DateTime?> veipls({
);
}

Future<TimeOfDay?> 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<TimeOfDay>(
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<String> list = <String>['baixa', 'média', 'alta'];

class DropdownButtonExample extends StatefulWidget {
Expand Down

0 comments on commit f7a4fce

Please sign in to comment.