GlobalBottomSheet class

Global utility class for displaying modal bottom sheets with consistent styling.

GlobalBottomSheet provides static methods to show bottom sheets across the application with standardized appearance and behavior. It leverages GetX's bottom sheet functionality with pre-configured styling for rounded corners, elevation, and scroll control.

Features:

  • Consistent rounded top corners (20px radius)
  • Configurable dismissible behavior
  • Result callback support for returning data
  • Future-based bottom sheets with loading states
  • Scroll-controlled content support

Example:

// Show a simple bottom sheet
GlobalBottomSheet.show(
  MyBottomSheetContent(),
  isDismissible: true,
  resultCallback: (result) => print('Result: $result'),
);

// Show a bottom sheet with async data
GlobalBottomSheet.showFutureWidget(
  bottomSheetFuture: fetchDataAndBuildWidget(),
  progressIndicator: CircularProgressIndicator(),
);

See also:

Constructors

GlobalBottomSheet()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

show(Widget bottomSheet, {bool isDismissible = true, dynamic resultCallback(dynamic value)?}) → void
Displays a modal bottom sheet with customizable content and behavior.
showFutureWidget({required Future<Widget> bottomSheetFuture, Widget? progressIndicator, Widget? loadingWidget, Color? backgroundColor, double elevation = 10, RoundedRectangleBorder? shapeBorder, bool isScrollControlled = true}) → void
Displays a modal bottom sheet with content loaded from a Future.