FlipWidget<T> constructor
- Key? key,
- required FlipType flipType,
- required Stream<
T> itemStream, - required ItemBuilder<
T> itemBuilder, - required AxisDirection flipDirection,
- T? initialValue,
- Duration flipDuration = const Duration(milliseconds: 800),
- Curve flipCurve = Curves.easeInOut,
- double hingeWidth = 0.0,
- double hingeLength = 0.0,
- Color? hingeColor,
- double perspectiveEffect = 0.006,
- VoidCallback? onDone,
- int startCount = 0,
FlipWidget constructor.
Four required parameters: required FlipType flipType, // Either FlipType.middleFlip or FlipType.spinFlip required Stream
And a number of optional parameters: T? initialValue, // Initial value to be displayed before the first animation Duration flipDuration, // Duration of the flip animation Curve flipCurve // Curve for flip animation, defaults to Curves.easeInOut double hingeWidth // Width of the middle hinge element, defaults to zero (must pair with lenth) double hingeLength // Length of the middle hinge element, default to zero (must pair with width) Color hingeColor // Color of the middle hinge element, defaults to null (transparent) double perspectiveEffect, // Perspective effect for the Transform Matrix4, defaults to 0.006 VoidCallback onDone, // Optional callback for onDone stream event int startCount, // Widget state count that allows the widget state to restart stream listening on widget update.
Implementation
const FlipWidget({
Key? key,
required this.flipType,
required this.itemStream,
required this.itemBuilder,
required this.flipDirection,
this.initialValue,
this.flipDuration = const Duration(milliseconds: 800),
this.flipCurve = Curves.easeInOut,
this.hingeWidth = 0.0,
this.hingeLength = 0.0,
this.hingeColor,
this.perspectiveEffect = 0.006,
this.onDone,
this.startCount = 0,
}) : assert(hingeWidth == 0.0 && hingeLength == 0.0 ||
hingeWidth != 0.0 && hingeLength != 0.0),
assert(hingeColor == null || hingeWidth != 0.0),
super(key: key);