Skip to content

[Feature Request] make TimePicker more friendly for extensions #121036

@matanshukry

Description

@matanshukry

Use case

I would like to create a time picker that includes seconds (and possibly even milliseconds).
Generally speaking there are 2 options:

  1. Create the widget on my own (or use a packge of someone who did it already).
  2. Extend the built in TimePicker widget, hopefully adding another text box on the side of it.

Doing the 2nd shouldn't be too difficult - however most of the clases of time picker are private, so I can't use them (or I need to copy-paste them all with little changes).

Proposal

  1. Make the various classes in TimePicker public rather than private; e.g. _RestorableTimePickerEntryMode
  2. Make the code a bit more modular so it's easier to extend/overide methods. Currently the build() method of the state is quite a long one. By separating it into different methods that can be overriden, it would make it easier to change parts of the code while still enjoying the current functionality (it's also easier to read the code btw :P)
  3. A bit similar to the point before, but perhaps also making the widgets more modular. e.g. making a generic input rather than. Even somethin like <T extends TimeOfDay is fine, so one can easily pass an extended version of that (with seconds/milliseconds).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterf: date/time pickerDate or time picker widgetsf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions