wheel_chooser

Creator: coderz1093

Last updated:

Add to Cart

Description:

wheel chooser

wheel_chooser #

WheelChooser is a widget allowing user to choose numbers/strings/widgets by scrolling spinners with wheel look.

Getting Started #
Install
dependencies:
wheel_chooser: ^1.1.2
copied to clipboard
Creating WheelChooser Widget
use it to show Strings
WheelChooser(
onValueChanged: (s) => print(s),
datas: ["a", "b", "c"],
);
copied to clipboard
use it to show Integers
WheelChooser.integer(
onValueChanged: (i) => print(i),
maxValue: 10,
minValue: 1,
step: 2,
);
copied to clipboard
use it to show display titles and return a value associated with the selected value

List<WheelChoice> aChoices = [
WheelChoice(value: DateTime(2000,1,1,9,0), title: '9AM'),
WheelChoice(value: DateTime(2000,1,1,9,30), title: '9:30AM'),
WheelChoice(value: DateTime(2000,1,1,10,0), title: '10AM'),
WheelChoice(value: DateTime(2000,1,1,10,30), title: '10:30AM'),
];

WheelChooser.choices(
choices = aChoices,
onChoiceChanged: (value) {
// returns DateTime of selected title
print('selected time is ${value.hour} hours and ${value.minutes} minutes')
}
);
copied to clipboard
use it to show CustomWidgets
WheelChooser.custom(
onValueChanged: (a) => print(a),
children: <Widget>[
Text("data1"),
Text("data2"),
Text("data3"),
],
);
copied to clipboard
Usage examples #

WheelChooser.integer(
onValueChanged: (s) => print(s.toString()),
maxValue: 18,
minValue: 1,
initValue: 5,
unSelectTextStyle: TextStyle(color: Colors.grey),
)
copied to clipboard

WheelChooser.integer(
onValueChanged: (s) => print(s.toString()),
maxValue: 20,
minValue: 1,
initValue: 9,
horizontal: true,
unSelectTextStyle: TextStyle(color: Colors.grey),
)
copied to clipboard
From v0.1.1 support Infinite.
From v1.0.0 support null safe.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.