0 purchases
dp stopwatch
The default widget Stopwatch() class has no method to get the values as a stream. It only outputs a single value whenever one of its methods is called. This repo brings a better version of stopwatch
Features #
Getting started #
The project shall migrate to null safety
Usage #
Create viewmodel
final stopwatchViewModel = DPStopwatchViewModel(
clockTextStyle: const TextStyle(
color: Colors.black,
fontSize: 32,
),
);
copied to clipboard
Bind the viewmodel to widget
...
DPStopWatchWidget(
stopwatchViewModel,
),
...
copied to clipboard
Control the widget via viewmodel, e.x. when user clicks a button
...
TextButton(
style: TextButton.styleFrom(
textStyle: const TextStyle(fontSize: 20),
),
onPressed: () {
stopwatchViewModel.pause?.call();
},
child: const Text('pause'),
),
...
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.