RawSlideCountdown constructor
const
RawSlideCountdown({
- required StreamDuration streamDuration,
- required RawSlideCountdownBuilder builder,
- Key? key,
A widget that displays a countdown based on a StreamDuration.
The RawSlideCountdown widget listens to the streamDuration.durationLeft stream and updates its display based on the received duration values.
The builder function is used to build the widget based on the current BuildContext and the remaining Duration received from the stream.
Example:
RawSlideCountdown(
streamDuration: myStreamDuration,
builder: (BuildContext context, Duration remainingDuration) {
return RawDigitItem(
duration: remainingDuration,
timeUnit: TimeUnit.seconds,
digitType: DigitType.second,
countUp: false,
);
},
)
In the above example, the RawSlideCountdown
widget listens to the
myStreamDuration.durationLeft
stream and updates the displayed text
based on the remaining duration.
See also:
- StreamDuration, which represents a stream of countdown durations.
- RawSlideCountdownBuilder, a function signature for the builder used to create the countdown widget.
Implementation
const RawSlideCountdown({
required this.streamDuration,
required this.builder,
super.key,
});