Updating readme

This commit is contained in:
Gaspard Merten 2023-04-12 10:16:47 +02:00
parent 6fa939b8b5
commit 600608cde8
5 changed files with 117 additions and 107 deletions

View File

@ -1,134 +1,129 @@
##3.0.2
# 3.0.4
* Adding click pointer for desktop and web
- Updating Changelog.md
##3.0.1
# 3.0.3
* Fixing [issue #29](https://github.com/GaspardMerten/date_field/issues/29) -> adding 24h format support for material time picker dialog
- Updating the README.md file. Adding more information about the package, rewriting the text to make it more appealing.
- Adding support for providing a different initial time mode for the material time picker dialog (thanks to @schalky).
##3.0.0
# 3.0.2
* Breaking Upgraded minimum Dart version to 2.15 for Constructor Tearoff support
* Added optional `DateTimeFieldCreator` argument to `DateTimeFormField` to allow specifying custom implementations of `DateTimeField`
* Refactored `DateTimeField` to expose `showMaterialTimePicker`, `showMaterialDatePicker`, and `showMaterialTimePicker` as separate overrideable methods
* Made `kCupertinoDatePickerHeight` and `cupertinoModeFromPickerMode` public for convenience
* Removed `DateTimeFormFieldState`, replaced by an instance of `FormFieldState<DateTime>`
* Fixed the behaviour of the `initialDate' parameter.
Added support for clickable pointer on desktop and web.
##2.1.3
# 3.0.1
* [TheGlorySaint](https://github.com/TheGlorySaint) added the possibility to use the 24Hour Format at the Timepicker. Default it is set to false
Fixed issue #29 by adding 24-hour format support for the material time picker dialog.
##2.1.2
# 3.0.0
* Adding the possibility to specify the initial date selected in the date picker dialog.
Upgraded the minimum Dart version to 2.15 for constructor tear-off support, which is a breaking change.
Added an optional DateTimeFieldCreator argument to DateTimeFormField for specifying custom implementations of DateTimeField.
Refactored DateTimeField to expose showMaterialTimePicker, showMaterialDatePicker, and showMaterialTimePicker as separate overrideable methods.
Made kCupertinoDatePickerHeight and cupertinoModeFromPickerMode public for convenience.
Removed DateTimeFormFieldState and replaced it with an instance of FormFieldState<DateTime>.
Fixed the behavior of the initialDate parameter.
##2.1.1
# 2.1.3
* Formatting with Dart FM
Added the possibility to use the 24-hour format for the time picker. Default is set to false.
##2.1.0
# 2.1.2
* Fixing label & hint style issues
* Moving to a more generic architecture
* Updating the analysis_options.yaml file
Added the ability to specify the initial date selected in the date picker dialog.
##2.0.1
# 2.1.1
* Adding the ability to specify the entry mode for the material date picker.
Formatted code with Dart FM.
##2.0.0
# 2.1.0
* Migrating to null-safety
Fixed label and hint style issues.
Moved to a more generic architecture.
Updated the analysis_options.yaml file.
# 2.0.1
##1.0.5
Added the ability to specify the entry mode for the material date picker.
* Removing unused variables
* Improving description
# 2.0.0
Migrated to null-safety.
##1.0.4
# 1.0.5
* Fixing critical issue
Removed unused variables and improved the description.
##1.0.3
# 1.0.4
* Improving package description
Fixed a critical issue.
##1.0.2
# 1.0.3
* Improving package description
Improved the package description.
##1.0.1
# 1.0.2
* Removing the ripple effect
Improved the package description.
##1.0.0
# 1.0.1
* Full support for input decoration
* New standardized usage, many deprecations
Removed the ripple effect.
##0.3.3
# 1.0.0
* Intl => any support
Added full support for input decoration.
Adopted a new standardized usage, with many deprecations.
Breaking change:
* Removing the label property, please consider using the InputDecoration to customize the label.
# 0.3.3
##0.3.2
Changed support from Intl to any, which is a breaking change.
Removed the label property, and suggested using the InputDecoration to customize the label.
* Formating with dartfm
# 0.3.2
##0.3.1
Formatted the code with Dart FM.
* Adding the possibility to style the text with TextStyle
# 0.3.1
## 0.3.0
Added the possibility to style the text with TextStyle.
Breaking changes:
* No more const constructor.
# 0.3.0
Deprecated:
* DateField and DateFormField are now deprecated and will be removed in the next version, please consider switching to
DateTimeField and DateTimeFormField.
Removed the const constructor, which is a breaking change.
Deprecated DateField and DateFormField, and added support for time.
Improved performance by setting the default value in the constructor.
Added a .time constructor for the DateField widget only.
Improvements:
* Adding support for time. Now you can ask the user for a time, a date or both.
* Improving performances by setting default value in the constructor.
* Adding .time constructor for the DateField widget only.
# 0.2.2
## 0.2.2
Formatted the code with dart-fm to meet pub.dev requirements.
* Auto-formatting with dart-fm to meet pub.dev requirements
# 0.2.1
## 0.2.1
Added support for Flutter web.
* Adding support for Flutter web
# 0.2.0
## 0.2.0
Changed DateFormField to extend FormField, and rigorously applied the style to match the theme or any customization.
* DateFormField now extends FormField. All issues related to this are now fiex
* The style of the DateField (and by extension the one of DateFormField) is now rigorously applying the theme or any customization.
# 0.1.2
## 0.1.2
Fixed an incorrect boolean value (the iOS picker was inverted with the Android one).
* Fixing an incorrect boolean (iOS picker was inverted with the Android one)
# 0.1.1
## 0.1.1
Formatted the code with DartFM.
* Formatting with DartFM!
# 0.1.0
## 0.1.0
Updated the documentation.
* Updating documentation!
# 0.0.2
## 0.0.2
Fixed the README.md and updated the package description.
Formatted the code with DartFM.
* Fixing README.md
* Updating package description
* Formatting with DartFM
## 0.0.1
# 0.0.1
* Initial version

View File

@ -1,16 +1,12 @@
# date_field
# Welcome to the Date Field package! 📅
[![pub package](https://img.shields.io/pub/v/date_field.svg)](https://pub.dartlang.org/packages/date_field)
[![pub package](https://img.shields.io/pub/v/date_field.svg)](https://pub.dev/packages/date_field)
This package provides two widgets, DateTimeField and DateTimeFormField, which allow users to pick a date and/or time from an input field. You can customize the appearance of the widgets using the decoration argument, and specify whether to ask for a date, a time, or both using the mode parameter.
Contains DateTimeField and DateTimeFormField which allows the user to pick a DateTime from an input field! Depending on
the mode, it can ask the user the time, the date or both at the same time ;) !
## Here's how to get started 🚀
<img src='https://raw.githubusercontent.com/GaspardMerten/date_field/master/example/demo.gif' height='250px'></img>
## Usage
In the `pubspec.yaml` of your flutter project, add the following dependency:
Add the date_field package to your project's dependencies in pubspec.yaml.
```yaml
dependencies:
@ -18,34 +14,41 @@ dependencies:
date_field: ^3.0.0
```
In your library add the following import:
Import the package in your Dart code.
```dart
import 'package:date_field/date_field.dart';
```
Use the DateTimeField or DateTimeFormField widget in your code, and customize it using the available parameters.
## Getting Started
## Available Parameters 📝
There are two widgets in this package:
- <b>onSaved</b>: a callback that is called when the form is saved.
- <b>validator</b>: a callback that is called to validate the value.
- <b>initialValue</b>: the initial value of the field.
- <b>autovalidateMode</b>: when to validate the field.
- <b>enabled</b>: whether the field is enabled or disabled.
- <b>use24hFormat</b>: whether to use a 24-hour format for the time picker.
- <b>dateTextStyle</b>: the text style for the date.
- <b>dateFormat</b>: the format of the date.
- <b>firstDate</b>: the earliest date that can be selected.
- <b>lastDate</b>: the latest date that can be selected.
- <b>initialDate</b>: the initial date that is selected.
- <b>onDateSelected</b>: a callback that is called when a date is selected.
- <b>decoration</b>: the decoration for the field.
- <b>initialEntryMode</b>: the initial entry mode of the date picker.
- <b>initialDatePickerMode</b>: the initial date picker mode.
- <b>mode</b>: the mode of the date and time picker.
- <b>initialTimePickerEntryMode</b>: the initial entry mode of the time picker.
- <b>fieldCreator</b>: the creator of the DateTimeField.
- DateTimeField
- DateTimeFormField
## Example Usage 📖
It follows the usual Flutter patterns convention, meaning the DateTimeFormField extends the FormField widget and wraps a DateTimeField widget.
Here's an example usage of <b>DateTimeFormField</b>:
You can customize both of these widgets with the decoration argument which is fully supported.
You can also specify whether you would like to ask the user for a date, a time or both using the mode parameter.
## Example
The following picture illustrates some things you can do with this package.
<img src='https://raw.githubusercontent.com/GaspardMerten/date_field/master/example/demo.gif' height='250px'></img>
``` dart
```dart
DateTimeFormField(
decoration: const InputDecoration(
hintStyle: TextStyle(color: Colors.black45),
@ -60,7 +63,19 @@ DateTimeFormField(
onDateSelected: (DateTime value) {
print(value);
},
),
)
```
You can check the GitHub repo for a complete example.
You can find more examples and a complete example on the GitHub repository. We hope this package is helpful to you!
## License 📜
This package is released under the MIT license.
## Contributing 🤝
Contributions to this package are welcome! If you find a bug or have a feature request, please create an issue on the GitHub repository. If you'd like to contribute code, please create a pull request with your changes.
Before submitting a pull request, please make sure to run the tests and ensure they all pass. Additionally, please follow the existing coding style and make sure your code is well-documented.
Thank you for your contributions!

1
example/.gitignore vendored
View File

@ -32,7 +32,6 @@
/build/
# Web related
lib/generated_plugin_registrant.dart
# Symbolication related
app.*.symbols

View File

@ -65,6 +65,7 @@ class _MyHomePageState extends State<MyHomePage> {
Form(
child: Column(
children: <Widget>[
DateTimeFormField(),
DateTimeFormField(
decoration: const InputDecoration(
hintStyle: TextStyle(color: Colors.black45),

View File

@ -1,6 +1,6 @@
name: date_field
description: A widget in the form of a field that lets people choose a date, a time or both.
version: 3.0.2
version: 3.0.4
homepage: 'https://github.com/GaspardMerten/date_field'
environment: