Skip to content

DatePicker ​

A text-field-styled date picker that opens Flutter's own date picker dialog, with an optional time component.

View source on GitHub ↗

CLI ​

Install this component into your project:

date-picker
$flutter_beautify add date-picker

Variants ​

FBDatePicker.outlined() · FBDatePicker.filled()

Key parameters ​

ParameterTypeDefault
selectedDateDateTime?—
onDateChangedValueChanged<DateTime?>?—
firstDate / lastDateDateTime?—
hintText / labelTextString'Select date' / ''
showTimeboolfalse — adds a time component

Usage ​

dart
import 'package:your_app/widgets/date_picker.dart';

FBDatePicker.outlined(
  selectedDate: dueDate,
  onDateChanged: (d) => setState(() => dueDate = d),
  showTime: true,
);

Released under the MIT License.