ir_datetime_picker 2.0.2 ir_datetime_picker: ^2.0.2 copied to clipboard
Iranian (persian,farsi,shamsi,jalali) datetime picker with cupertino style and responsive ui.
Iranian date & time picker #
Iranian (persian,farsi,shamsi,jalali) datetime picker with cupertino style and responsive ui.
Demo: #
Usage #
Step1: add dependency to your pubspec.yaml:
dependencies:
ir_datetime_picker: version
Step2: import library:
import 'package:ir_datetime_picker/ir_datetime_picker.dart';
Step3: check exmaple to use:
// case1: use top level function showIRDatePickerDialog:
ElevatedButton(
child: const Text("pick date with dialog"),
onPressed: () async {
Jalali? selectedDate = await showIRDatePickerDialog(context);
if (selectedDate != null) {
setState(() {
_date = "${selectedDate.year}/${selectedDate.month}/${selectedDate.day}";
});
}
},
)
// case2: use top level function showIRDatePickerRoute:
ElevatedButton(
child: const Text("pick date with route"),
onPressed: () async {
Jalali? selectedDate = await showIRDatePickerRoute(context);
if (selectedDate != null) {
setState(() {
_date = "${selectedDate.year}/${selectedDate.month}/${selectedDate.day}";
});
}
},
)
// case3: custom use:
IRDatePicker(
onSelected: (Jalali selectedDate) {
setState(() {
_date = "${selectedDate.year}/${selectedDate.month}/${selectedDate.day}";
});
},
)