showDatePicker function
Shows a rich, modern modal bottom sheet date picker styled with Nash UI tokens.
final date = await showDatePicker(context);
Implementation
Future<DateTime?> showDatePicker(
BuildContext context, {
DateTime? initialDate,
DateTime? firstDate,
DateTime? lastDate,
String title = 'Select Date',
String? locale,
}) =>
showModalBottomSheet<DateTime>(
context: context,
isScrollControlled: true,
backgroundColor: Colors.transparent,
builder: (ctx) => _DatePickerBottomSheet(
initialDate: initialDate ?? DateTime.now(),
firstDate: firstDate ?? DateTime(1900),
lastDate: lastDate ?? DateTime(2100),
title: title,
locale: locale,
),
);