Material Duration Picker

A duration picker using the material (M3) design guidelines of the time picker.

Features

duration_picker.gif

Getting started

dart pub add material_duration_picker

Usage

Add the default localization delegate (the global delegate is not support yet):

import 'package:material_duration_picker/material_duration_picker.dart';

MaterialApp(
  localizationsDelegates: const [
    DefaultDurationPickerMaterialLocalizations.delegate,
  ],
  // ...
),
IconButton(
  icon: const Icon(Icons.timelapse),
  onPressed: () {
    showDurationPicker(
      context: context,
      initialDuration: Duration.zero,
    );
  },
),

DurationPickerDialog(
  durationPickerMode: DurationPickerMode.hm,
  initialDuration: Duration(hours: 1, minutes: 30, seconds: 45),
),

DurationPickerDialog(
  durationPickerMode: DurationPickerMode.hms,
  initialEntryMode: DurationPickerEntryMode.input,
  initialDuration: Duration(hours: 1, minutes: 30, seconds: 45),
),

Additional information

The package was meant to be integrated directly in the Material Widget Library. This implementation is kept in sync with the changes of the Flutter time_picker. In case the Material and/or Flutter team decides to include it, the package is kept in sync with the Flutter Pull-Request.