unit_number_input

A Flutter package for entering minutes and seconds with built-in validation, auto-conversion to total seconds, and input decoration. Originally created for OpenHIIT. Currently only handles minutes and seconds, could be expanded for other values.

unit_number_input GIF

Table of Contents

  1. Installation
  2. Basic Usage
    1. Example Usage
  3. Contributing
    1. Code of Conduct
  4. License

Installation

Add unit_number_input to your pubspec.yaml file:

dependencies:
  flutter:
    sdk: flutter
  unit_number_input: ^0.1.0

Basic Usage

  1. Define a controller:
final UnitNumberInputController _controller = UnitNumberInputController();
  1. Create a UnitNumberInput widget and pass the controller:
UnitNumberInput(
  controller: _controller,
  onChanged: (seconds) {
    print("Total seconds: $seconds");
  },
),

Example Usage

Check out the example directory in this repository for a complete example of how to use unit_number_input in a Flutter app.

Contributing

View the contributing documentation. If contributing code changes, please checkout the testing documentation.

Code of Conduct

When contributing, please keep the Code of Conduct in mind.

License

unit_number_input is open-source software released under the MIT License. You are free to modify and distribute the application under the terms of this license. See the LICENSE file for more information.

Please note that this README file is subject to change as the application evolves. Refer to the latest version of this file in the repository for the most up-to-date information.

Libraries

unit_number_input