hcShowDialog<T> function

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

Implementation

Future<T?> hcShowDialog<T>({
  required BuildContext context,
  bool barrierDismissible = true,
  Widget? child,
  WidgetBuilder? builder,
}) {
  assert(child == null || builder == null);
  assert(debugCheckHasMaterialLocalizations(context));

  final ThemeData theme = Theme.of(
    context,
  );
  return showGeneralDialog(
    context: context,
    pageBuilder: (BuildContext buildContext, Animation<double> animation,
        Animation<double> secondaryAnimation) {
      final Widget pageChild = child ?? Builder(builder: builder!);
      return Builder(builder: (BuildContext context) {
        return Theme(data: theme, child: pageChild);
      });
    },
    barrierDismissible: barrierDismissible,
    barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
    barrierColor: Colors.black54,
    transitionDuration: const Duration(milliseconds: 400),
    transitionBuilder: _hcBuildTransition,
  );
}