A Flutter counter widget, supports min/max/initial/bound/step value with type num, and supports appearance configuration.
- Add dependency to
pubspec.yaml, and run
flutter pub get
- import the package
- expample code
Counter( /// min value min: 0, /// max value max: 10, /// bound value, default null，must be greater than or equal to [min] and less than or equal to [max]. /// current value can not be greater than [min] and less than bound if bound is not null and its approved. /// if current value is [min], and bound value greater than [min] too, and the value will be change with bound value by one step after inscrease button clicked. /// and it will be change with [min] value by one step after descrease button clicked. bound: 3, /// initial value, default equal to [min], must be greater than or equal to [min] and less than or equal to [max]. /// and initial value must be greater or equal to [bound], while bound and initial value both not be null. initial: 5, /// stepper，default 1 step: 1, /// appearance configuration，default DefaultConfiguration() /// you can also set up custom appearance by implements [Configuration] class. configuration: DefaultConfiguration(), /// value changed callback. onValueChanged: print, )
- feature support
xsupport type num(include int/double) values.
xsupport min/max/initial/bound values.
xsupport set up custom appearance.
xsupport value changed callback.