Why is this package needed? #
ISO 8601 has a character limit for time-secfrac part equal to 6. RFC 3339 does not have that limit. Thanks to this, datetimes introducing more than 6 characters in time-secfrac are invalid for
DateTime.parse, because it works only with ISO 8601.
For example, Go's
encoding/json serializes dates with 7 time-secfrac characters.
import 'rfc_3339_date_time_serializer/rfc_3339_date_time_serializer.dart'; @SerializersFor(const [/* (...) */]) final Serializers modelsSerializers = (_$modelsSerializers.toBuilder() ..addPlugin(StandardJsonPlugin()) ..add(RFC3339DateTimeSerializer())) // this is the line you need to add .build();
- Readme changes and reformatted code.
- Initial commit
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: rfc_3339_date_time_serializer: ^1.0.1
2. Install it
You can install packages from the command line:
$ pub get
$ flutter pub get
Alternatively, your editor might support
pub get or
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Dec 4, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.6.1
- pana: 0.12.21
Detected platforms: Flutter, web, other
No platform restriction found in primary library
Maintain an example. (-10 points)
Create a short demo in the
example/ directory to show how to use this package.
Common filename patterns include
rfc_3339_date_time_serializer.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.