showCommonBottomSheet<T> function
Presents child wrapped in a BottomSheetPanel via Flutter's native
showModalBottomSheet.
Safe to call from any normal routed Material screen. Do not call this
from a screen that has an active Flame GameWidget on top without
checking first — per this repo's Dialog pattern (CLAUDE.md "Dialog
pattern" / neon_dialog.dart), Get.dialog/showDialog are no-ops once
a GameWidget is on screen, and showModalBottomSheet rides the same
Navigator/route machinery, so it likely has the same problem there.
This base project currently has no Flame GameWidget screen, so it's
safe everywhere today — a future game build should verify before reusing
this helper on a game screen (fall back to NeonDialog.overlay instead).
Implementation
Future<T?> showCommonBottomSheet<T>(
BuildContext context, {
required Widget child,
Color? color,
bool isDismissible = true,
bool enableDrag = true,
bool useRootNavigator = false,
Color? barrierColor,
}) {
return showModalBottomSheet<T>(
context: context,
backgroundColor: Colors.transparent,
isScrollControlled: true,
isDismissible: isDismissible,
enableDrag: enableDrag,
useRootNavigator: useRootNavigator,
barrierColor: barrierColor,
builder: (_) => SafeArea(
child: BottomSheetPanel(color: color, child: child),
),
);
}