flutter_time picker_spinner
a flutter widget to set time with spinner instead of material time picker.
12h format
24h format
24h format with second
custom style
getting started
this project is a starting point for a dart
package,
a library module containing code that can be shared easily across
multiple flutter or dart projects.
for help getting started with flutter, view our
online documentation, which offers tutorials,
samples, guidance on mobile development, and a full api reference.
props
props | types | defaultvalues |
---|---|---|
time | datetime | current time [ datetime.now() ] |
minutesinterval | int | 1 |
secondsinterval | int | 1 |
is24hourmode | bool | true |
isshowseconds | bool | false |
isshowseconds | bool | false |
highlightedtextstyle | textstyle | false |
normaltextstyle | textstyle | false |
itemheight | double | 60.0 |
itemwidth | double | 45.0 |
spacing | double | 20.0 |
alignment | alignmentgeometry | alignment.centerright |
isforce2digits | bool | false |
ontimechange | timepickercallback |
usage
import 'package:flutter_time_picker_spinner/flutter_time_picker_spinner.dart';
widget widget() {
return new timepickerspinner(
is24hourmode: false,
normaltextstyle: textstyle(
fontsize: 24,
color: colors.deeporange
),
highlightedtextstyle: textstyle(
fontsize: 24,
color: colors.yellow
),
spacing: 50,
itemheight: 80,
isforce2digits: true,
ontimechange: (time) {
setstate(() {
_datetime = time;
});
},
);
}
Comments are closed.