showJHijriPicker function
Future<HijriDate?>
showJHijriPicker({
- required BuildContext context,
- JDateModel? selectedDate,
- JDateModel? startDate,
- JDateModel? endDate,
- DatePickerMode pickerMode = DatePickerMode.day,
- String? okButton,
- PickerType pickerType = PickerType.JHijri,
- String? cancelButton,
- Widget? headerTitle,
- Widget? buttons,
- dynamic onOk(
- HijriDate datetime
- dynamic onChange(
- HijriDate datetime
- VoidCallback? onCancel,
- ThemeData? theme,
- Color? primaryColor,
- Color? backgroundColor,
- Color? calendarTextColor,
- Color? buttonTextColor,
- SelectableDayPredicate? selectableDayPredicate,
- Radius? borderRadius,
- TextDirection? textDirection,
- Locale? locale,
Implementation
Future<HijriDate?> showJHijriPicker({
required BuildContext context,
JDateModel? selectedDate,
JDateModel? startDate,
JDateModel? endDate,
DatePickerMode pickerMode = DatePickerMode.day,
String? okButton,
PickerType pickerType = PickerType.JHijri,
String? cancelButton,
Widget? headerTitle,
Widget? buttons,
Function(HijriDate datetime)? onOk,
Function(HijriDate datetime)? onChange,
VoidCallback? onCancel,
ThemeData? theme,
Color? primaryColor,
Color? backgroundColor,
Color? calendarTextColor,
Color? buttonTextColor,
SelectableDayPredicate? selectableDayPredicate,
Radius? borderRadius,
TextDirection? textDirection,
Locale? locale,
}) {
Widget dialog = JHijriPicker(
startDate: startDate,
selectedDate: selectedDate,
endDate: endDate,
pickerMode: pickerMode,
themeD: theme,
textDirection: textDirection,
locale: locale,
okButtonT: okButton,
cancelButtonT: cancelButton,
onOk: onOk,
onCancel: onCancel,
primaryColor: primaryColor,
calendarTextColor: calendarTextColor,
backgroundColor: backgroundColor,
borderRadius: borderRadius,
buttonTextColor: buttonTextColor,
headerTitle: headerTitle,
buttons: buttons,
widgetType: WidgetType.JDialog,
onChange: onChange,
selectableDayPredicate: selectableDayPredicate,
);
if (pickerType != PickerType.JHijri) {
dialog = JWesternDatePicker(
startDate: startDate,
selectedDate: selectedDate,
endDate: endDate,
pickerMode: pickerMode,
themeD: theme,
textDirection: textDirection,
locale: locale,
okButtonT: okButton,
cancelButtonT: cancelButton,
onOk: onOk,
onCancel: onCancel,
primaryColor: primaryColor,
calendarTextColor: calendarTextColor,
backgroundColor: backgroundColor,
borderRadius: borderRadius,
buttonTextColor: buttonTextColor,
headerTitle: headerTitle,
buttons: buttons,
widgetType: WidgetType.JDialog,
onChange: onChange,
);
}
return showDialog<HijriDate?>(
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}