WOICountdowns class
The WOICountdowns is a circular timer widget that has an optional initial pre timer loading timer. Here is an example for the timer
Padding(
padding: const EdgeInsets.all(20),
child: WOICountdowns(
timeInSeconds: 10,
timerSize: 200,
timerWidth: 20,
coolDownTimerValue: 3,
timerBackgroundColor: Colors.amber[100]!,
timerFillColor: Colors.amber,
cooldownTimerBoxDecoration: BoxDecoration(
color: Colors.grey.shade300,
borderRadius: BorderRadius.circular(200),
),
),
),
The WOICountdowns widget takes the timeInSeconds as a required variable which is the total time that the timer will run for.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- WOICountdowns
Constructors
- WOICountdowns({required double timeInSeconds, double timerSize = 200, double timerWidth = 15, Color timerBackgroundColor = Colors.lightBlue, Color timerFillColor = Colors.orange, double cooldownTimerSize = 200, Widget? initialCooldownTimerCenter = const Icon(Icons.play_arrow_outlined, size: 100), BoxDecoration cooldownTimerBoxDecoration = const BoxDecoration(color: Colors.blueGrey, borderRadius: BorderRadius.all(Radius.circular(200))), int? coolDownTimerValue, TextStyle? coolDownTimerTextStyle, Widget? pausedTimerCenterWidget = const Icon(Icons.pause, size: 100), Widget? timerCompletionCenterWidget = const Icon(Icons.celebration, size: 100), dynamic onChange(double timerValue)?, dynamic onStateChange(TimerState state)?, Key? key})
-
const
Properties
- cooldownTimerBoxDecoration → BoxDecoration
-
Box decoration for the initial widget and the cooldown timer widget.
final
- cooldownTimerSize → double
-
The size of the initial widget that starts the timer and the size of the ready up timer.
final
- coolDownTimerTextStyle → TextStyle?
-
The ready up timer countdown textstyle.
final
- coolDownTimerValue → int?
-
The time for for the initial ready up timer. Giving this a 0 value will remove the ready up timer.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialCooldownTimerCenter → Widget?
-
The center widget on the most initial state of the timer. By default it is the play arrow icon. Can be null.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onChange → dynamic Function(double timerValue)?
-
Function that can be used to implement any changes for when the time on the timer changes. This function return the current value of time that the timer represents.
final
- onStateChange → dynamic Function(TimerState state)?
-
This function returns the current state of the widget and can be used to implement changes on state change. There are total of 5 states namely: initial, preTimerRunning, timerRunning, pausedTimer, timerCompleted.
final
- pausedTimerCenterWidget → Widget?
-
The center widget for when the timer is paused. Can be null
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeInSeconds → double
-
The total time for which the timer will run.
final
- timerBackgroundColor → Color
-
Color of the unfilled part of the timer.
final
- timerCompletionCenterWidget → Widget?
-
The center widget when the timer is completed. Can be null
final
- timerFillColor → Color
-
Color of the filled part of the timer.
final
- timerSize → double
-
The space that the circular timer will take.
final
- timerWidth → double
-
Width of the circular timer.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< WOICountdowns> -
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}) → 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