stfDialog<T> function

Future<T?> stfDialog<T>(
  1. BuildContext context0,
  2. Widget child, {
  3. double height = 300,
})

Implementation

Future<T?> stfDialog<T>(BuildContext context0, Widget child, {double height = 300}) {
  BuildContext context = NavigationService.defaultKey.currentState!.overlay!.context;
  return showDialog<T>(
    context: context,
    barrierDismissible: true,
    builder: (context) {
      return Material(
        child: StatefulBuilder(
          builder: (context, setState) {
            return Container(
              height: height,
              width: MediaQuery.of(context).size.width,
              child: child,
            );
          },
        ),
      );
    },
  );
}