StacPageView class
A Stac model representing Flutter's PageView
widget.
A scrollable list that works page by page, with each child being a full page.
{@tool snippet} Dart Example:
StacPageView(
initialPage: 0,
keepPage: true,
viewportFraction: 1.0,
children: [
StacContainer(color: '#FF0000'),
StacContainer(color: '#00FF00'),
],
)
{@end-tool}
{@tool snippet} JSON Example:
{
"type": "pageView",
"initialPage": 0,
"keepPage": true,
"viewportFraction": 1.0,
"children": [
{ "type": "container", "color": "#FF0000" },
{ "type": "container", "color": "#00FF00" }
]
}
{@end-tool}
See also:
- Flutter's PageView documentation (
https://api.flutter.dev/flutter/widgets/PageView-class.html
)
- Inheritance
-
- Object
- StacElement
- StacWidget
- StacPageView
- Annotations
-
- @JsonSerializable()
Constructors
-
StacPageView.new({StacAxis? scrollDirection, bool? reverse, StacScrollPhysics? physics, bool? pageSnapping, StacAction? onPageChanged, StacDragStartBehavior? dragStartBehavior, bool? allowImplicitScrolling, String? restorationId, StacClip? clipBehavior, bool? padEnds, int? initialPage, bool? keepPage, double? viewportFraction, List<
StacWidget> ? children}) -
Creates a StacPageView.
const
-
StacPageView.fromJson(Map<
String, dynamic> json) -
Creates a StacPageView from a JSON map.
factory
Properties
- allowImplicitScrolling → bool?
-
Whether to allow implicit scrolling.
final
-
children
→ List<
StacWidget> ? -
The list of pages to display.
final
- clipBehavior → StacClip?
-
The clip behavior for the content.
final
- dragStartBehavior → StacDragStartBehavior?
-
The drag start behavior for drag gestures.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialPage → int?
-
The initial page to display.
final
-
jsonData
→ Map<
String, dynamic> ? -
Raw JSON data for this widget
finalinherited
- keepPage → bool?
-
Whether to save the current page with the
PageController
.final - onPageChanged → StacAction?
-
Action invoked when the page changes.
final
- padEnds → bool?
-
Whether to add padding to the ends of the list.
final
- pageSnapping → bool?
-
Whether to snap to page boundaries during scrolling.
final
- physics → StacScrollPhysics?
-
The scroll physics to use for the page view.
final
- restorationId → String?
-
The restoration ID to restore scroll offset across app launches.
final
- reverse → bool?
-
Whether the page view scrolls in the reading direction.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollDirection → StacAxis?
-
The axis along which the page view scrolls.
final
- type → String
-
Widget type identifier.
no setteroverride
- viewportFraction → double?
-
Fraction of the viewport that each page should occupy.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Converts this StacPageView instance to a JSON map.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited