FlipWidget<T> constructor

const FlipWidget<T>({
  1. Key? key,
  2. required FlipType flipType,
  3. required Stream<T> itemStream,
  4. required ItemBuilder<T> itemBuilder,
  5. required AxisDirection flipDirection,
  6. T? initialValue,
  7. Duration flipDuration = const Duration(milliseconds: 800),
  8. Curve flipCurve = Curves.easeInOut,
  9. double hingeWidth = 0.0,
  10. double hingeLength = 0.0,
  11. Color? hingeColor,
  12. double perspectiveEffect = 0.006,
  13. VoidCallback? onDone,
  14. 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);