|
|
|
|
@ -6,8 +6,10 @@ class ADateTimePicker extends StatelessWidget {
|
|
|
|
|
final DateTime from;
|
|
|
|
|
final DateTime to;
|
|
|
|
|
final Function(DateTime) onDateTimePicker;
|
|
|
|
|
final bool enable;
|
|
|
|
|
|
|
|
|
|
const ADateTimePicker({Key key, this.date, this.onDateTimePicker, this.from, this.to}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
const ADateTimePicker({Key key, this.date, this.onDateTimePicker, this.from, this.to, this.enable}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
@ -23,10 +25,10 @@ class ADateTimePicker extends StatelessWidget {
|
|
|
|
|
date == null ? "Pick Time" : date.toString().substring(0, date.toString().lastIndexOf(":")),
|
|
|
|
|
textScaleFactor: AppStyle.getScaleFactor(context),
|
|
|
|
|
),
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
onPressed: enable? () async {
|
|
|
|
|
// TimeOfDay picked = await showTimePicker(context: context, initialTime: TimeOfDay.now());
|
|
|
|
|
onDateTimePicker(await showDateTimePicker(context: context, initialDate: date, firstDate: from, lastDate: to));
|
|
|
|
|
},
|
|
|
|
|
}: null,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|