flutter date range picker
flutter date range pickers use a dialog window to select a range of date on mobile.
demo
getting started
installation
add to pubspec.yaml
in dependencies
date_range_picker: ^1.0.3
usage
import 'package:date_range_picker/date_range_picker.dart' as dateragepicker;
...
new materialbutton(
color: colors.deeporangeaccent,
onpressed: () async {
final list<datetime> picked = await dateragepicker.showdatepicker(
context: context,
initialfirstdate: new datetime.now(),
initiallastdate: (new datetime.now()).add(new duration(days: 7)),
firstdate: new datetime(2015),
lastdate: new datetime(2020)
);
if (picked != null && picked.length == 2) {
print(picked);
}
},
child: new text("pick date range")
)
Comments are closed.