FlipCountdownClock constructor
FlipCountdownClock({
- Key? key,
- required Duration duration,
- required double digitSize,
- required double width,
- required double height,
- AxisDirection flipDirection = AxisDirection.up,
- Curve? flipCurve,
- Color? digitColor,
- Color? backgroundColor,
- double? separatorWidth,
- Color? separatorColor,
- Color? separatorBackgroundColor,
- bool? showBorder,
- double? borderWidth,
- Color? borderColor,
- BorderRadius borderRadius = const BorderRadius.all(Radius.circular(4.0)),
- double hingeWidth = 0.8,
- double? hingeLength,
- Color? hingeColor,
- EdgeInsets digitSpacing = const EdgeInsets.symmetric(horizontal: 2.0),
- VoidCallback? onDone,
FlipCountdownClock constructor.
Parameters define clock digits and flip panel appearance.
- flipDirection defaults to AxisDirection.up.
- flipCurve defaults to null, that will deliver FlipWidget.defaultFlip.
- digitColor and separatorColor defaults to colorScheme.onPrimary.
- backgroundColor defauts to colorScheme.primary.
- separatorWidth defaults to width / 3.
- separatorColor defaults to colorScheme.onPrimary.
- separatorBackground defaults to null (transparent).
- showBorder can be set or defaults to true if boderColor or borderWidth is set
- borderWidth defaults to 1.0 when a borderColor is set
- borderColor defaults to colorScheme.onPrimary when a width is set.
- borderRadius defaults to Radius.circular(4.0)
- digitSpacing defaults to horizontal: 2.0
- hingeWidth defaults to 0.8
- hindeLength defaults to CrossAxis size
- hingeColor defaults to null (transparent)
Implementation
FlipCountdownClock({
Key? key,
required this.duration,
required double digitSize,
required double width,
required double height,
AxisDirection flipDirection = AxisDirection.up,
Curve? flipCurve,
Color? digitColor,
Color? backgroundColor,
double? separatorWidth,
Color? separatorColor,
Color? separatorBackgroundColor,
bool? showBorder,
double? borderWidth,
Color? borderColor,
BorderRadius borderRadius = const BorderRadius.all(Radius.circular(4.0)),
double hingeWidth = 0.8,
double? hingeLength,
Color? hingeColor,
EdgeInsets digitSpacing = const EdgeInsets.symmetric(horizontal: 2.0),
this.onDone,
}) : _showHours = duration.inHours > 0,
_displayBuilder = FlipClockBuilder(
digitSize: digitSize,
width: width,
height: height,
flipDirection: flipDirection,
flipCurve: flipCurve,
digitColor: digitColor,
backgroundColor: backgroundColor,
separatorWidth: separatorWidth ?? width / 3.0,
separatorColor: separatorColor,
separatorBackgroundColor: separatorBackgroundColor,
showBorder: showBorder ?? (borderColor != null || borderWidth != null),
borderWidth: borderWidth,
borderColor: borderColor,
borderRadius: borderRadius,
hingeWidth: hingeWidth,
hingeLength: hingeWidth == 0.0
? 0.0
: hingeLength ??
(flipDirection == AxisDirection.down || flipDirection == AxisDirection.up ? width : height),
hingeColor: hingeColor,
digitSpacing: digitSpacing,
);