Search packages, repositories and app categories

Package detailsv1.0.4

flutter_duration_picker

A widget for picking durations, inspired by Material Time Picker.

30-day downloads
60
Likes
54
Pub points
40

Install package

flutter pub add flutter_duration_picker

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter widget designed for selecting durations, modeled after the Material Time Picker. It provides an intuitive interface for choosing time intervals such as hours, minutes, and seconds, making it ideal for applications requiring duration input—like timers, workout apps, or scheduling tools. The picker supports customizable step increments and is built with Material Design principles for a consistent user experience across platforms.

Use cases

  • Setting timer durations
  • Configuring workout session lengths
  • Scheduling events with duration
  • Inputting task time estimates
  • Creating countdown timers

Key features

  • Material Design-inspired UI
  • Customizable time step increments
  • Supports hours, minutes, and seconds
  • Simple integration with existing forms
  • Responsive and accessible layout

Suitable for

  • Apps needing duration selection
  • Form inputs requiring time intervals
  • Mobile applications using Material design
  • Developers seeking lightweight time pickers
  • Projects with minimal dependencies

Considerations

  • No platform-specific customization options listed
  • Limited to basic duration input without advanced features
  • Does not support AM/PM or date components
  • Requires manual handling of validation
  • No built-in localization support mentioned

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Duration Picker for flutter

A little widget for picking durations. Heavily inspired from the Material Design time picker widget.

This repo is unmaintained, please check out the fork here: https://github.com/juliansteenbakker/duration_picker

Example Usage:

dependencies:
  flutter_duration_picker: "^1.0.0"
import 'package:flutter/material.dart';
import 'package:flutter_duration_picker/flutter_duration_picker.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Duration Picker Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new MyHomePage(title: 'Duration Picker Demo'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  Duration _duration = Duration(hours: 0, minutes: 0);
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text(widget.title),
      ),
      body: new Center(
        child: new Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            new Expanded(
		// Use it from the context of a stateful widget, passing in
		// and saving the duration as a state variable.
                child: DurationPicker(
              duration: _duration,
              onChange: (val) {
                this.setState(() => _duration = val);
              },
              snapToMins: 5.0,
            ))
          ],
        ),
      ),
      floatingActionButton: Builder(
          builder: (BuildContext context) => new FloatingActionButton(
                onPressed: () async {
		  // Use it as a dialog, passing in an optional initial time
		  // and returning a promise that resolves to the duration
		  // chosen when the dialog is accepted. Null when cancelled.
                  Duration resultingDuration = await showDurationPicker(
                    context: context,
                    initialTime: new Duration(minutes: 30),
                  );
                  Scaffold.of(context).showSnackBar(new SnackBar(
                      content: new Text("Chose duration: $resultingDuration")));
                },
                tooltip: 'Popup Duration Picker',
                child: new Icon(Icons.add),
              )),
    );
  }
}

Categories

Source repository

Projects using this package

No data available yet.