h-1.flutter.0/lib/widgets/modal_utils.dart

20 lines
614 B
Dart

import 'package:flutter/material.dart';
/// Presents a rounded feature modal with consistent safe-area handling.
Future<T?> showFeatureModalBottomSheet<T>({
required BuildContext context,
required WidgetBuilder builder,
double heightFactor = 0.9,
bool isScrollControlled = true,
Color backgroundColor = Colors.transparent,
}) {
return showModalBottomSheet<T>(
context: context,
isScrollControlled: isScrollControlled,
backgroundColor: backgroundColor,
builder: (sheetContext) => FractionallySizedBox(
heightFactor: heightFactor,
child: builder(sheetContext),
),
);
}