showElasticDialog<T> function Null safety

Future<T?> showElasticDialog<T>(
  1. {required BuildContext context,
  2. bool barrierDismissible = true,
  3. WidgetBuilder? builder}
)

Implementation

Future<T?> showElasticDialog<T>({
  required BuildContext context,
  bool barrierDismissible = true,
  WidgetBuilder? builder,
}) {
  final ThemeData theme = Theme.of(context);
  return showGeneralDialog(
    context: context,
    pageBuilder: (BuildContext buildContext, Animation<double> animation,
        Animation<double> secondaryAnimation) {
      final Widget pageChild = Builder(builder: builder!);
      return SafeArea(
        child: Builder(builder: (BuildContext context) {
          return theme != null
              ? Theme(data: theme, child: pageChild)
              : pageChild;
        }),
      );
    },
    barrierDismissible: barrierDismissible,
    barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
    barrierColor: Colors.black54,
    transitionDuration: const Duration(milliseconds: 550),
    transitionBuilder: _buildDialogTransitions,
  );
}