modalPopUp<T> static method

Future<T>? modalPopUp<T>(
  1. BuildContext context,
  2. Widget page, {
  3. Color? colors,
})

Implementation

static Future<T>? modalPopUp<T>(BuildContext context, Widget page,
    {Color? colors}) {
  Future add = showDialog<void>(
    context: context,
    barrierDismissible: true,
    barrierColor: colors == null ? Colors.black : colors,
    useSafeArea: true,
    builder: (BuildContext dialogContext) {
      return page;
    },
  );

  add.then((value) {
    return value;
  });
}