{"id":21199093,"url":"https://github.com/m3uzz/date_time_picker","last_synced_at":"2025-10-21T18:03:44.646Z","repository":{"id":40644086,"uuid":"282078000","full_name":"m3uzz/date_time_picker","owner":"m3uzz","description":"A Flutter widget to show a text form field to display a date or clock dialog. This widget extend TextField and has a similar behavior as TextFormField.","archived":false,"fork":false,"pushed_at":"2024-07-22T14:21:37.000Z","size":358,"stargazers_count":105,"open_issues_count":66,"forks_count":170,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T07:07:04.427Z","etag":null,"topics":["dart","date","field","flutter","picker","text","time","widget"],"latest_commit_sha":null,"homepage":"https://pub.dartlang.org/packages/date_time_picker","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m3uzz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"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}},"created_at":"2020-07-23T23:30:30.000Z","updated_at":"2024-12-11T08:06:09.000Z","dependencies_parsed_at":"2024-06-18T16:48:21.800Z","dependency_job_id":"8a1cf32d-daef-483c-9821-e58dc65e0aed","html_url":"https://github.com/m3uzz/date_time_picker","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m3uzz%2Fdate_time_picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m3uzz%2Fdate_time_picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m3uzz%2Fdate_time_picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m3uzz%2Fdate_time_picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m3uzz","download_url":"https://codeload.github.com/m3uzz/date_time_picker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305934,"owners_count":20917208,"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","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","date","field","flutter","picker","text","time","widget"],"created_at":"2024-11-20T19:56:55.002Z","updated_at":"2025-10-21T18:03:39.592Z","avatar_url":"https://github.com/m3uzz.png","language":"Dart","funding_links":["https://www.buymeacoffee.com/hslbetto"],"categories":[],"sub_categories":[],"readme":"# date_time_picker\n\n[![pub package](https://img.shields.io/pub/v/date_time_picker.svg)](https://pub.dartlang.org/packages/date_time_picker)\n\n\u003ca href=\"https://www.buymeacoffee.com/hslbetto\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-blue.png\" alt=\"Buy Me A Beer\" style=\"width: 150px !important;\"\u003e\u003c/a\u003e\n\nA Flutter widget to show a text form field to display a date or clock dialog.\\\nThis widget extend TextField and has a similar behavior as TextFormField\n\n## Usage\n\nIn the `pubspec.yaml` of your flutter project, add the following dependency:\n\n```yaml\ndependencies:\n  ...\n  date_time_picker: \"^2.1.0\"\n```\n\nIn your library add the following import:\n\n```dart\nimport 'package:date_time_picker/date_time_picker.dart';\n```\n\nFor help getting started with Flutter, view the online [documentation](https://flutter.io/).\n\n## Example\n\nThere are four presentations for DateTimePicker and can be defined in the type parameter:\n* `DateTimePickerType.date` will present a text field with the action tap showing a datePicker dialog box;\n* `DateTimePickerType.time` will present a text field with the action tap showing a timePicker dialog box;\n* `DateTimePickerType.dateTime` will present a text field with the action tap showing a datePicker dialog box then a timePicker dialog box;\n* `DateTimePickerType.dateTimeSeparated` will display two text fields side by side, the first for date and the second for time. Each displaying their respective dialog box, datePicker and timePicker in the tap action;\n  \n``` dart\nDateTimePicker(\n  type: date, // options: [date | time | dateTime | dateTimeSeparated], default is date\n  ...\n)\n```\n\ninitialValue or controller.text can be `null`, `empty` or a `DateTime string` otherwise it will throw an error.\n\n``` dart\nDateTimePicker(\n  initialValue: '',\n  firstDate: DateTime(2000),\n  lastDate: DateTime(2100),\n  dateLabelText: 'Date',\n  onChanged: (val) =\u003e print(val),\n  validator: (val) {\n    print(val);\n    return null;\n  },\n  onSaved: (val) =\u003e print(val),\n);\n```\n\nMore complete example:\n\n\n``` dart\nDateTimePicker(\n  type: DateTimePickerType.dateTimeSeparate,\n  dateMask: 'd MMM, yyyy',\n  initialValue: DateTime.now().toString(),\n  firstDate: DateTime(2000),\n  lastDate: DateTime(2100),\n  icon: Icon(Icons.event),\n  dateLabelText: 'Date',\n  timeLabelText: \"Hour\",\n  selectableDayPredicate: (date) {\n    // Disable weekend days to select from the calendar\n    if (date.weekday == 6 || date.weekday == 7) {\n      return false;\n    }\n\n    return true;\n  },\n  onChanged: (val) =\u003e print(val),\n  validator: (val) {\n    print(val);\n    return null;\n  },\n  onSaved: (val) =\u003e print(val),\n);\n```\n\nThe result of val in `onChanged`, `validator` and `onSaved` will be a DateTime String or just a Time String:\n* ex.: [2020-07-20 14:30] or [15:30] DateTimePickerType.time;\n* month, day, hour and minute will be 2 digits and time always be in 24 hours mode;\n* but the presentation in text field can be formated by the dateMask parameter.\n\n\n## Preview\n![Overview](https://raw.githubusercontent.com/m3uzz/date_time_picker/master/doc/images/date_time_picker.gif)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm3uzz%2Fdate_time_picker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm3uzz%2Fdate_time_picker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm3uzz%2Fdate_time_picker/lists"}