Date picker
Use a date picker when someone needs to choose a single day. A date a person already knows can also be entered in separate day, month and year fields.
Set a due date
#Set a due date in November. Some looks open a calendar from a field, others display it in place, and Civic takes the date as three numbers.
components/date-picker/appliance/set_due_date.dart
import 'package:flutter/widgets.dart';
import 'package:material_ui/material_ui.dart' show MaterialLocalizations;
import 'package:appliance_ui/appliance_ui.dart';
class SetDueDate extends StatefulWidget {
const SetDueDate({super.key});
@override
State<SetDueDate> createState() => _SetDueDateState();
}
class _SetDueDateState extends State<SetDueDate> {
var due = DateTime(2026, 11, 12);
@override
Widget build(BuildContext context) => ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 400),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ApplianceDatePicker(
firstDate: DateTime(2026, 11),
lastDate: DateTime(2026, 12, 31),
label: 'Due date',
value: due,
onChanged: (next) => setState(() => due = next),
currentDate: DateTime(2026, 11, 12),
),
const SizedBox(height: 12),
Text(
'Due: ${MaterialLocalizations.of(context).formatCompactDate(due)}',
),
],
),
),
);
}
Parameters
ApplianceDatePicker API ↗value- Selected due date.
firstDate- Earliest available date.
lastDate- Latest available date.
onChanged- Receives the chosen day.
Shared behaviour
- Keyboard and focus. Tab to the field or calendar. Use the calendar’s month controls to browse, or type into each part of a date input.
- Screen readers. Inspect the day names, selected date or labelled date fields. Read the date in those fields or in the summary below the calendar.
- Direction and type. Switch direction to see how the date parts and month controls line up. At phone width, scroll the preview to reach a tall calendar.