FlutterDateTime class

Cross-platform date / time pickers built on top of flutter_helper_kit.

Date formatting uses the kit's DateTime.format extension (no intl dependency) and sizes use the kit's responsive units (RSizedBox).

Colors follow the current Theme; override backgroundColor / accentColor per call when needed.

final date = await FlutterDateTime.pickDate(context: context);
final label = FlutterDateTime.formatDate(date);

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

formatDate(DateTime? date, {String pattern = _datePattern}) String
Formats a date via the helper-kit extension (empty string when null).
formatTime(TimeOfDay? time, {bool use24hFormat = true}) String
Formats a time (24h by default) via the helper-kit extension.
pickDate({required BuildContext context, DateTime? initialDate, DateTime? firstDate, DateTime? lastDate, PickerStyle style = PickerStyle.platform, String doneLabel = 'Done', String cancelLabel = 'Cancel', Locale? locale, Color? backgroundColor, Color? accentColor}) Future<DateTime?>
pickDateRange({required BuildContext context, DateTime? firstDate, DateTime? lastDate, PickerStyle style = PickerStyle.platform, String doneLabel = 'Done', String cancelLabel = 'Cancel', Color? backgroundColor, Color? accentColor}) Future<DateTimeRange<DateTime>?>
pickDateTime({required BuildContext context, DateTime? initialDateTime, DateTime? firstDate, DateTime? lastDate, PickerStyle style = PickerStyle.platform, bool use24hFormat = true, Color? backgroundColor, Color? accentColor}) Future<DateTime?>
pickDOB({required BuildContext context, PickerStyle style = PickerStyle.platform, String doneLabel = 'Done', String cancelLabel = 'Cancel', Locale? locale, Color? backgroundColor, Color? accentColor}) Future<DateTime?>
Date picker preset for Date of Birth (max = today, default 18 yrs ago).
pickTime({required BuildContext context, TimeOfDay? initialTime, PickerStyle style = PickerStyle.platform, bool use24hFormat = true, String doneLabel = 'Done', String cancelLabel = 'Cancel', Color? backgroundColor, Color? accentColor}) Future<TimeOfDay?>