PageFlipWidget class
A high-fidelity, physics-based page flip widget for Flutter.
Displays a book-like page-flipping interface with drag and tap gestures. Supports dark mode, haptic feedback, sound effects, and custom effect handlers.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PageFlipWidget
Constructors
-
PageFlipWidget({required IndexedWidgetBuilder itemBuilder, required int itemCount, Key? key, PageFlipController? controller, Object? contentRevision, PageFlipConfig config = PageFlipConfig.defaultSettings, int initialIndex = 0, bool isDoubleSpread = false, PageFlipSpreadMode? spreadMode, void onPageFlipped(int pageNumber)?, void onFlipStart()?, void onFlipEnd()?, void onPageChanged(int pageNumber)?, FutureOr<
void> onHandleEffect(PageFlipEvent effect, {int? intensity, double? resistance, double? texture, double? volume})?, void onEffectError(PageFlipEvent effect, Object error, StackTrace stackTrace)?}) - Creates a PageFlipWidget with the given pages and configuration.
Properties
- config → PageFlipConfig
-
Configuration for animations, gestures, haptics, and effects.
final
- contentRevision → Object?
-
Declarative content revision for the visible capture window.
final
- controller → PageFlipController?
-
Optional external controller for programmatic navigation.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialIndex → int
-
Index of the initially visible page.
final
- isDoubleSpread → bool
-
True if rendering for a dual spread book (legacy; prefer spreadMode).
final
- itemBuilder → IndexedWidgetBuilder
-
Builder for individual page widgets.
final
- itemCount → int
-
Total number of pages.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onEffectError → void Function(PageFlipEvent effect, Object error, StackTrace stackTrace)?
-
Called when an effect handler throws or completes with an error.
final
- onFlipEnd → void Function()?
-
Called when a flip gesture or animation completes (whether successful or cancelled).
final
- onFlipStart → void Function()?
-
Called when a flip gesture starts (drag or tap).
final
-
onHandleEffect
→ FutureOr<
void> Function(PageFlipEvent effect, {int? intensity, double? resistance, double? texture, double? volume})? -
Custom callback for handling raw effects. Overrides the built-in handler.
final
- onPageChanged → void Function(int pageNumber)?
-
Called when the current page index changes.
final
- onPageFlipped → void Function(int pageNumber)?
-
Called when a page flip animation completes successfully.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spreadMode → PageFlipSpreadMode
-
Spread layout mode (defaults from isDoubleSpread when omitted).
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → PageFlipWidgetState -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited