StacModalBottomSheetAction class

Core model for the "showModalBottomSheet" action.

Displays a Flutter showModalBottomSheet with content sourced from a STAC widget. Defaults (scroll control, dismissibility, etc.) are applied in the parser, not the model.

Dart example:

const StacModalBottomSheetAction(
  widget: StacWidget.fromJson({"type": "text", "data": {"text": "Hello"}}),
);

JSON example:

{
  "actionType": "showModalBottomSheet",
  "widget": {"type": "text", "data": {"text": "Hello"}}
}
Inheritance
Available extensions
Annotations
  • @JsonSerializable.new()

Constructors

StacModalBottomSheetAction({StacWidget? widget, StacNetworkRequest? request, String? assetPath, String? backgroundColor, String? barrierLabel, double? elevation, StacBorder? shape, StacBoxConstraints? constraints, String? barrierColor, bool? isScrollControlled, bool? useRootNavigator, bool? isDismissible, bool? enableDrag, bool? showDragHandle, bool? useSafeArea})
Creates a StacModalBottomSheetAction that shows a modal bottom sheet.
const
StacModalBottomSheetAction.fromJson(Map<String, dynamic> json)
Creates a StacModalBottomSheetAction from JSON.
factory

Properties

actionType String
Unique action type string used for routing.
no setteroverride
assetPath String?
Path to a local asset JSON for the widget.
final
backgroundColor String?
Background color hex for the sheet.
final
barrierColor String?
Barrier color hex behind the sheet.
final
barrierLabel String?
Semantics label for the modal barrier.
final
constraints StacBoxConstraints?
Box constraints applied to the sheet.
final
elevation double?
Elevation of the bottom sheet.
final
enableDrag bool?
Whether the sheet is draggable.
final
hashCode int
The hash code for this object.
no setterinherited
isDismissible bool?
Whether the sheet is dismissible by tapping the barrier.
final
isScrollControlled bool?
Whether the sheet can take full height when scrolled.
final
jsonData Map<String, dynamic>?
The raw JSON data associated with this action.
finalinherited
request StacNetworkRequest?
Network request to fetch widget content.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shape StacBorder?
Shape border of the bottom sheet.
final
showDragHandle bool?
Whether to show the drag handle.
final
useRootNavigator bool?
Whether to use the root navigator.
final
useSafeArea bool?
Whether to respect the safe area.
final
widget StacWidget?
Content widget to display inside the bottom sheet.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(BuildContext context) FutureOr

Available on StacAction?, provided by the StacActionParserExtension extension

toJson() Map<String, dynamic>
Converts this action to JSON.
override
toString() String
A string representation of this object.
inherited

Operators

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