Duration Spinbox

style: very good analysis Powered by Mason License: MIT

A duration widget for Flutter, heavily inspired by flutter_spinbox

Installation 💻

❗ In order to start using Duration Spinbox you must have the Flutter SDK installed on your machine.

Install via flutter pub add:

dart pub add duration_spinbox

or just add this line to your pubspec.yaml

duration_spinbox: ^0.1.0


Currently this only shows the Duration in the format mm:ss, more customization options to come in the future.

The only required parameter is value which is the initial/current duration.

  value: Duration(minutes: 1),

This is designed to work similar to DropDownButton where you have to update the value when changed. Like this:

var _duration = Duration(minutes: 1);


  value: _duration,
  onChanged: (value){
      _duration = value;

You can set a minimum and maximum value. By default minimum is Duration.zero but max is by default null.

  value: Duration(minutes: 1),
  min: Duration(minutes: 1),
  max: Duration(minutes: 5),

You can set the stepValue which is the Duration the value will be increased or decreased. By default it is Duration(minutes: 1).

  value: Duration.zero,
  stepValue: Duration(minutes: 5),

By default min is equal to Duration.zero, to allow negative values you have to set min to null manually.

  value: Duration(minutes: 0),
  min: null,

What's next

  • Formatting options
  • Editing options
  • Customization options


A duration widget for Flutter, heavily inspired by flutter_spinbox