showDialog<T> method
Future<T?>
showDialog<T>({
- required WidgetBuilder builder,
- Cancellable? cancellable,
- bool barrierDismissible = true,
- Color? barrierColor = Colors.black54,
- String? barrierLabel,
- bool useSafeArea = true,
- RouteSettings? routeSettings,
- Offset? anchorPoint,
推入一个可撤销的dialog
Implementation
Future<T?> showDialog<T>({
required WidgetBuilder builder,
Cancellable? cancellable,
bool barrierDismissible = true,
Color? barrierColor = Colors.black54,
String? barrierLabel,
bool useSafeArea = true,
bool useRootNavigator = true,
RouteSettings? routeSettings,
Offset? anchorPoint,
// TraversalEdgeBehavior? traversalEdgeBehavior,
}) {
assert(debugCheckHasMaterialLocalizations(context));
final CapturedThemes themes = InheritedTheme.capture(
from: context,
to: context,
);
final route = DialogRoute<T>(
context: context,
builder: builder,
barrierColor: barrierColor,
barrierDismissible: barrierDismissible,
barrierLabel: barrierLabel,
useSafeArea: useSafeArea,
settings: routeSettings,
themes: themes,
anchorPoint: anchorPoint,
// traversalEdgeBehavior:
// traversalEdgeBehavior ?? TraversalEdgeBehavior.closedLoop,
);
return pushCancellableRoute(route, cancellable);
}