uistepper 0.0.2 copy "uistepper: ^0.0.2" to clipboard
uistepper: ^0.0.2 copied to clipboard

A widget for incrementing or decrementing a value by using +/- buttons. This is a Flutter implementation of the UIStepper control found in Apple iOS UIKit.

Flutter UIStepper widget #

A widget for incrementing or decrementing a value by using +/- buttons. This is a Flutter implementation of the UIStepper control found in Apple iOS UIKit.

Image 1

Usage #

First import it in your Dart code:

import 'package:uistepper/uistepper.dart';

Instantinate it in your build method and use a double property to store its value:

double stepperValue = 1;
//...
UIStepper(
    value: stepperValue, 
    onChanged: (value) { setState(() => stepperValue = value); }
);

Specify minimum and maximum values by using the corresponding minimumValue and maximumValue properties. The increment/decrement step is determined by the stepValue property, The wraps property indicates whether to wrap the current value to its minumum or maximum values when using stepValue different than 1:

UIStepper(
    value: stepperValue, 
    minumumValue: 1,
    maximumValue: 100,
    stepValue: 5,
    wraps: true,
    onChanged: (value) { setState(() => stepperValue = value); }
);

You can customize various attributes, for example the tintColor property sets +/- button color and the showLabel property determines whether to show or not the label:

UIStepper(
    value: stepperValue, 
    tintColor: Colors.red,
    showLabel: false,
    onChanged: (value) { setState(() => stepperValue = value); }
);
5
likes
90
pub points
16%
popularity

Publisher

unverified uploader

A widget for incrementing or decrementing a value by using +/- buttons. This is a Flutter implementation of the UIStepper control found in Apple iOS UIKit.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on uistepper