Control.dateRange constructor
Implementation
factory Control.dateRange({
required String key,
String? title,
String? description,
void Function(dynamic)? onChange,
DateTimeRange? value,
DateTime? min,
DateTime? max,
Widget? prefixIcon,
}) =>
Control(
key: key,
type: ControlType.dateRange,
title: title,
description: description,
onChange: onChange,
value: <String, DateTime?>{
'selected-start': value?.start ?? DateTime.now(),
'selected-end':
value?.end ?? DateTime.now().add(const Duration(days: 1)),
'min': min ?? value?.start ?? DateTime.now(),
'max': max ??
(min ?? value?.start ?? DateTime.now())
.add(const Duration(days: 365)),
},
prefixIcon: prefixIcon,
);