OpenCustomSheet class
A class responsible for displaying customized modal bottom popup.
This refactored class uses specific factory constructors for each sheet type, ensuring that the build logic is clean, separated, and robust.
Constructors
- OpenCustomSheet({required Widget body({ScrollController? scrollController}), dynamic onClose(dynamic)?, bool barrierDismissible = true, Color? barrierColor, Color? backgroundColor, Color? handleColor, ShapeBorder? sheetShape, EdgeInsetsGeometry? sheetPadding, bool enableDrag = true, bool showDragHandle = true, double initialChildSize = 0.5, double minChildSize = 0.25, double maxChildSize = 1.0})
-
PUBLIC: Standard (non-scrollable) sheet constructor.
For confirm/scrollable/expandable use the dedicated factories.
const
- OpenCustomSheet.expandable(BuildContext context, {required Widget header, required Widget body({ScrollController? scrollController}), ExpandableController? controller, bool presentAsRoute = true, double initialChildSize = 0.3, double minChildSize = 0.3, double maxChildSize = 0.9, Color? backgroundColor, Color? barrierColor, Color? handleColor, EdgeInsetsGeometry? sheetPadding, bool barrierDismissible = true, bool enableDrag = true, bool showDragHandle = true})
-
Factory for an expandable sheet that can behave as a modal route or as an in-route overlay widget.
factory
- OpenCustomSheet.openConfirmSheet(BuildContext context, {required Widget body, dynamic onClose(dynamic)?, Color? backgroundColor, Color? barrierColor, Color? handleColor, bool barrierDismissible = true, bool enableDrag = true, bool showDragHandle = true, Color? firstButtonColor, Color? secondButtonColor, Color? firstButtonTextColor, Color? secondButtonTextColor, String? confirmButtonText, String? cancelButtonText, EdgeInsetsGeometry? padding, double? buttonSpacing})
-
Factory for a simple, non-scrollable confirmation sheet with default buttons.
factory
- OpenCustomSheet.scrollableSheet(BuildContext context, {required Widget body({ScrollController? scrollController}), dynamic onClose(dynamic)?, bool expand = true, double initialChildSize = 0.5, double minChildSize = 0.25, double maxChildSize = 1.0, Color? barrierColor, Color? backgroundColor, Color? handleColor, bool barrierDismissible = true, bool enableDrag = true, bool showDragHandle = true, ShapeBorder? sheetShape, EdgeInsetsGeometry? sheetPadding})
-
Factory for a standard scrollable sheet.
factory
Properties
- backgroundColor → Color?
-
final
- barrierColor → Color?
-
final
- barrierDismissible → bool
-
final
-
final
- cancelButtonText → String?
-
final
- confirmButtonText → String?
-
final
- enableDrag → bool
-
final
- expand → bool
-
final
- firstButtonColor → Color?
-
final
- firstButtonTextColor → Color?
-
final
- handleColor → Color?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialChildSize → double
-
final
- maxChildSize → double
-
final
- minChildSize → double
-
final
- onClose → dynamic Function(dynamic)?
-
final
- padding → EdgeInsetsGeometry?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollable → bool
-
final
- secondButtonColor → Color?
-
final
- secondButtonTextColor → Color?
-
final
- sheetPadding → EdgeInsetsGeometry?
-
final
- sheetShape → ShapeBorder?
-
final
- showDefaultButtons → bool
-
final
- showDragHandle → bool
-
final
Methods
-
buildExpandable(
BuildContext context) → Widget -
Builds the expandable widget for in-route usage (inside a Stack).
Use this when the factory was created with
presentAsRoute: false. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
show(
BuildContext context) → void - Displays the configured sheet.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited