{"id":32281097,"url":"https://github.com/gerardo-m/duration_spinbox","last_synced_at":"2025-10-23T00:54:23.472Z","repository":{"id":246152763,"uuid":"820235931","full_name":"gerardo-m/duration_spinbox","owner":"gerardo-m","description":"duration widget for Flutter heavily inspired by flutter_spinbox widget","archived":false,"fork":false,"pushed_at":"2025-09-12T04:49:50.000Z","size":302,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T00:54:22.644Z","etag":null,"topics":["dart","flutter","flutter-widgets","pubdev"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gerardo-m.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-26T04:39:13.000Z","updated_at":"2025-09-13T18:46:44.000Z","dependencies_parsed_at":"2024-06-28T06:22:18.851Z","dependency_job_id":"c5aa4d6c-ee56-4fa3-a8a0-3e660436e2ac","html_url":"https://github.com/gerardo-m/duration_spinbox","commit_stats":null,"previous_names":["gerardo-m/duration_spinbox"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/gerardo-m/duration_spinbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerardo-m%2Fduration_spinbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerardo-m%2Fduration_spinbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerardo-m%2Fduration_spinbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerardo-m%2Fduration_spinbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gerardo-m","download_url":"https://codeload.github.com/gerardo-m/duration_spinbox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gerardo-m%2Fduration_spinbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280540651,"owners_count":26347724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","flutter","flutter-widgets","pubdev"],"created_at":"2025-10-23T00:54:22.174Z","updated_at":"2025-10-23T00:54:23.464Z","avatar_url":"https://github.com/gerardo-m.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Duration Spinbox\n\n[![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link]\n[![Powered by Mason](https://img.shields.io/endpoint?url=https%3A%2F%2Ftinyurl.com%2Fmason-badge)](https://github.com/felangel/mason)\n[![License: MIT][license_badge]][license_link]\n\nA duration widget for Flutter, heavily inspired by flutter_spinbox\n\n## Installation 💻\n\n**❗ In order to start using Duration Spinbox you must have the [Flutter SDK][flutter_install_link] installed on your machine.**\n\nInstall via `flutter pub add`:\n\n```sh\ndart pub add duration_spinbox\n```\n\nor just add this line to your pubspec.yaml\n\n```yaml\nduration_spinbox: ^0.2.0\n```\n\n## Basic Usage\n\nThe only required parameter is `value` which is the initial/current duration.\n\n```dart\nDurationSpinbox(\n  value: Duration(minutes: 1),\n),\n```\n\nThis is designed to work similar to `DropDownButton` where you have to update\nthe value when changed. Like this:\n\n```dart\nvar _duration = Duration(minutes: 1);\n\n...\n\nDurationSpinbox(\n  value: _duration,\n  onChanged: (value){\n    setState((){\n      _duration = value;\n    });\n  },\n),\n```\n\n## Optional Parameters\n\n### Step Value\nYou can set the `stepValue` which is the Duration the value will be increased\nor decreased. By default it is `Duration(minutes: 1)`.\n\n```dart\nDurationSpinbox(\n  value: Duration.zero,\n  stepValue: Duration(minutes: 5),\n),\n```\n\n### Min and Max Values\nYou can set a minimum and maximum value. By default min is `Duration.zero`\nand max is `null`.\n\n```dart\nDurationSpinbox(\n  value: Duration(minutes: 1),\n  min: Duration(minutes: 1),\n  max: Duration(minutes: 5),\n),\n```\n\nBy default min is equal to Duration.zero, to allow negative values you have to \nset min to null manually.\n\n```dart\nDurationSpinbox(\n  value: Duration(minutes: 0),\n  min: null,\n),\n```\n\n## Format Options\n\n### Predefined Formats\nThere are several predefined formats to show the duration as text, the\ndefault is mmmss, which means it will show minutes and seconds, with the\nminutes value uncapped. To change it provide a format:\n\n```dart\nDurationSpinbox(\n  value: const Duration(hours: 2, minutes: 1, seconds: 1, milliseconds: 100),\n  stepValue: const Duration(seconds: 1),\n  format: DurationFormat.hhmmss,\n),\n```\n\n### Custom Formatter\nYou can also provide a function to format the duration value into a String:\n\n```dart\nDurationSpinbox(\n  value: const Duration(minutes: 1, seconds: 1),\n  stepValue: const Duration(seconds: 1),\n  formatter: (value) {\n    final minutes = value.inMinutes;\n    final seconds = value.inSeconds.remainder(60);\n    return 'Value is $minutes minutes and $seconds seconds';\n  },\n),\n```\n\n## What's next\n\n* More formatting options\n* Editing options\n* Customization options\n---\n\n[flutter_install_link]: https://docs.flutter.dev/get-started/install\n[license_badge]: https://img.shields.io/badge/license-MIT-blue.svg\n[license_link]: https://opensource.org/licenses/MIT\n[logo_black]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_black.png#gh-light-mode-only\n[logo_white]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_white.png#gh-dark-mode-only\n[mason_link]: https://github.com/felangel/mason\n[very_good_analysis_badge]: https://img.shields.io/badge/style-very_good_analysis-B22C89.svg\n[very_good_analysis_link]: https://pub.dev/packages/very_good_analysis\n[very_good_ventures_link]: https://verygood.ventures\n[very_good_ventures_link_light]: https://verygood.ventures#gh-light-mode-only\n[very_good_ventures_link_dark]: https://verygood.ventures#gh-dark-mode-only\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerardo-m%2Fduration_spinbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgerardo-m%2Fduration_spinbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerardo-m%2Fduration_spinbox/lists"}