nepali date picker
material and cupertino style datepicker with bikram sambat(nepali) calendar support. supports android, ios and fuchsia. available in nepali and english languages.
nepali date picker returns data in nepalidatetime type, which is
included in nepali_utils
package.
salient features
- material datepicker
- cupertino datepicker
- adaptive datepicker
- supports from 2000 b.s. to 2099 b.s.
usage
material style datepicker
import 'package:nepali_date_picker/nepali_date_picker.dart' as picker;
nepalidatetime _selecteddatetime = await picker.showmaterialdatepicker(
context: context,
initialdate: nepalidatetime.now(),
firstdate: nepalidatetime(2000),
lastdate: nepalidatetime(2090),
language: _language,
initialdatepickermode: datepickermode.day,
);
print(_selecteddatetime); // 2076-02-16t00:00:00
cupertino style date picker
picker.showcupertinodatepicker(
context: context,
initialdate: nepalidatetime.now(),
firstdate: nepalidatetime(2000),
lastdate: nepalidatetime(2090),
language: _language,
dateorder: _dateorder,
ondatechanged: (newdate) {
print(_selecteddatetime);
},
);
adaptive date picker
shows datepicker based on platform.
i.e. cupertino datepicker will be shown on ios while material on android and fuchsia.
nepalidatetime _selecteddatetime = await picker.showadaptivedatepicker(
context: context,
initialdate: nepalidatetime.now(),
firstdate: nepalidatetime(2000),
lastdate: nepalidatetime(2090),
language: _language,
dateorder: _dateorder, // for ios only
initialdatepickermode: datepickermode.day, // for platform except ios
);
screenshots
material design (portrait)
material design (landscape)
cupertino design
Comments are closed.