showCDialog<T> function

Future<T?> showCDialog<T>({
  1. required BuildContext context,
  2. required WidgetBuilder builder,
  3. Cancellable? cancellable,
  4. bool barrierDismissible = true,
  5. Color? barrierColor = Colors.black54,
  6. String? barrierLabel,
  7. bool useSafeArea = true,
  8. bool useRootNavigator = true,
  9. RouteSettings? routeSettings,
  10. Offset? anchorPoint,
})

Implementation

Future<T?> showCDialog<T>({
  required BuildContext context,
  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 navigator = Navigator.of(context, rootNavigator: useRootNavigator);

  final CapturedThemes themes = InheritedTheme.capture(
    from: context,
    to: navigator.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 navigator.pushCancellableRoute(route, cancellable);
}