WOICountdownTimer class

The WOICountdownTimer is a fully customizable digital timer.

Simply use the timer widget by calling it directly. This will build a widget with some pre-defined values of sizes and alignments. These values can be changed as per need.

const WOICountdownTimer(
isHoursNeeded: true,
)
Inheritance

Constructors

WOICountdownTimer({double timerHeight = 250, double timerWidth = 300, double horizontalPadding = 25, double verticalPadding = 15, double timerFontSize = 35, double scrollableHeight = 140, double scollableWidth = 50, double scrollableTileSize = 50, Function? onStart, dynamic onPause(int timeValueInSeconds)?, Function? onStop, bool isHoursNeeded = false, Widget startButtonWidget = const Text('Start', style: TextStyle(color: Colors.white, fontSize: 25)), Widget pauseButtonWidget = const Text('Pause', style: TextStyle(color: Colors.white, fontSize: 25)), Widget stopButtonWidget = const Text('Stop', style: TextStyle(color: Colors.white, fontSize: 25)), bool changeSeparatorColor = false, Color selectedTimerValueColor = Colors.white, Color unselectedTimerValueColor = Colors.grey, TextStyle labelTextStyle = const TextStyle(color: Colors.white), BoxDecoration timerBoxDecoration = const BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(20)), color: Colors.black), BoxDecoration? pauseButtonBoxDecoration, BoxDecoration? stopButtonBoxDecoration, BoxDecoration? startButtonBoxDecoration, double? pauseButtonHeight, double? pauseButtonWidth, double? startButtonHeight, double? startButtonWidth, double? stopButtonHeight, double? stopButtonWidth, Key? key})
const

Properties

changeSeparatorColor → bool
Boolean value to determine if the color of the separator dots should change to the selectedTimerValueColor or stay white.
final
hashCode → int
The hash code for this object.
no setterinherited
horizontalPadding → double
Left and right padding of the contents of the widget.
final
isHoursNeeded → bool
Option to choose if timer for hours is needed or not.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
labelTextStyle → TextStyle
Text style of the labels at top namely, the hours, minutes and seconds labels.
final
onPause → dynamic Function(int timeValueInSeconds)?
This function is called every time the timer is paused.
final
onStart → Function?
This function is called once when the timer starts.
final
onStop → Function?
This function is called once when the timer is stopped.
final
pauseButtonBoxDecoration → BoxDecoration?
The decoration of the pause button.
final
pauseButtonHeight → double?
Height of the pause buttton.
final
pauseButtonWidget → Widget
Widget of the pause button of the timer. By default it is a text widget that says 'Pause'.
final
pauseButtonWidth → double?
Width of the pause button.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scollableWidth → double
Width of the scrollable part
final
scrollableHeight → double
Height of the scollable part of the timer. Increasing this will increase the number of digits visible in the scroller.
final
scrollableTileSize → double
Size of a single tile of the scollable.
final
selectedTimerValueColor → Color
Color of the active value on the scrollable.
final
startButtonBoxDecoration → BoxDecoration?
The decoration of the start button.
final
startButtonHeight → double?
Height of the start button.
final
startButtonWidget → Widget
Widget of the start button of the timer. By default it is a text widget that says 'Start'.
final
startButtonWidth → double?
Width of the start button.
final
stopButtonBoxDecoration → BoxDecoration?
The decoration of the stop button.
final
stopButtonHeight → double?
Height of the stop button.
final
stopButtonWidget → Widget
Widget of the stop button of the timer. By default it is a text widget that says 'Stop'.
final
stopButtonWidth → double?
Width of the stop button.
final
timerBoxDecoration → BoxDecoration
The decoration of the widget as a whole.
final
timerFontSize → double
Font size of the timer digits.
final
timerHeight → double
Height of the complete widget.
final
timerWidth → double
Width of the complete widget.
final
unselectedTimerValueColor → Color
Color of the inactive value on the scrollable.
final
verticalPadding → double
Top and bottom padding of the contents of the widget.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<WOICountdownTimer>
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, int wrapWidth = 65}) → 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