angel_serialize_generator 2.4.1+1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 77

angel_serialize_generator #

The builder for Angel's model serialization.

Find documentation in the main project repo: https://github.com/angel-dart/serialize

2.4.1+1 #

  • Change as Iterable<Map> to .cast<Map>.

2.4.1 #

  • Support serializesTo.
  • Don't emit @required if there is a default value.
  • Deprecate autoIdAndDateFields.

2.4.0 #

  • Introduce @SerializableField, and say goodbye to annotation hell.
  • Support custom (de)serializers.
  • Allow passing of annotations to the generated class.
  • Fixted TypeScript ref generator.

2.3.0 #

  • Add @DefaultValue support.

2.2.2 #

  • Split out TS def builder, to emit to source.

2.2.1 #

  • Explicit changes for assisting angel_orm_generator.

2.2.0 #

  • Build to cache.
  • Only generate one .g.dart file.
  • Support for Uint8List.
  • Use .cast() for Lists and Maps of non-Model types.

2.1.2 #

  • Add declare module to generated TypeScript files.

2.1.1 #

  • Generate hashCode.

2.1.0 #

  • Removed dependency on package:id.
  • Update dependencies for Dart2Stable.
  • jsonModelBuilder now uses SharedPartBuilder, rather than PartBuilder.

2.0.10 #

  • Generate XFields.allFields constant.
  • No longer breaks in cases where dynamic is present.
  • Call toJson in toMap on nested models.
  • Never generate named parameters from private fields.
  • Use the new @generatedSerializable to always find generated models.

2.0.9+4 #

  • Remove defaults in build.yaml.

2.0.9+3 #

  • Fix a cast error when self-referencing nested list expressions.

2.0.9+2 #

  • Fix previously unseen cast errors with enums.

2.0.9+1 #

  • Fix a cast error when deserializing nested model classes.

2.0.9 #

  • Upgrade to source_gen@^0.8.0.

2.0.8+3 #

  • Don't fail on null in toMap.
  • Support self-referencing via toJson().

2.0.8+2 #

  • Better discern when custom methods disqualify classes from const protection.

2.0.8+1 #

  • Fix generation of const constructors with iterables.

2.0.8 #

  • Now supports de/serialization of enum types.
  • Generate const constructors when possible.
  • Remove whereType, perform manual coercion.
  • Generate a fromMap with typecasting, for Dart 2's sake.

2.0.7 #

  • Create unmodifiable Lists and Maps.
  • Support @required on fields.
  • Affix an @immutable annotation to classes, if package:meta is imported.
  • Add /// <reference path="..." /> to TypeScript models.

2.0.6 #

  • Support for using abstract to create immutable model classes.
  • Add support for custom constructor parameters.
  • Closed #21 - better naming of Map types.
  • Added overridden == operators.

2.0.5 #

  • Deserialization now supports un-serialized DateTime.
  • Better support for regular typed Lists and Maps in TypeScript.

2.0.4 #

  • Fields in TypeScript definitions are now nullable by default.

2.0.3 #

  • Added a TypeScriptDefinitionBuilder.

2.0.2 #

  • Generates an XFields class with the serialized names of all fields in a model class X.
  • Removed unnecessary named parameters from XSerializer.fromMap.

2.0.1 #

  • Ensured that List is only transformed if it generically references a Model.

example/main.dart

// ignore_for_file: unused_element
import 'package:angel_serialize/angel_serialize.dart';

@serializable
class _Todo {
  String text;
  bool completed;
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  angel_serialize_generator: ^2.4.1+1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:angel_serialize_generator/angel_serialize_generator.dart';
  
Version Uploaded Documentation Archive
2.4.1+1 Jan 27, 2019 Go to the documentation of angel_serialize_generator 2.4.1+1 Download angel_serialize_generator 2.4.1+1 archive
2.4.1 Jan 9, 2019 Go to the documentation of angel_serialize_generator 2.4.1 Download angel_serialize_generator 2.4.1 archive
2.4.0 Jan 7, 2019 Go to the documentation of angel_serialize_generator 2.4.0 Download angel_serialize_generator 2.4.0 archive
2.3.0 Dec 31, 2018 Go to the documentation of angel_serialize_generator 2.3.0 Download angel_serialize_generator 2.3.0 archive
2.2.2 Dec 9, 2018 Go to the documentation of angel_serialize_generator 2.2.2 Download angel_serialize_generator 2.2.2 archive
2.2.1 Dec 8, 2018 Go to the documentation of angel_serialize_generator 2.2.1 Download angel_serialize_generator 2.2.1 archive
2.2.0 Dec 8, 2018 Go to the documentation of angel_serialize_generator 2.2.0 Download angel_serialize_generator 2.2.0 archive
2.1.2 Nov 29, 2018 Go to the documentation of angel_serialize_generator 2.1.2 Download angel_serialize_generator 2.1.2 archive
2.1.1 Nov 3, 2018 Go to the documentation of angel_serialize_generator 2.1.1 Download angel_serialize_generator 2.1.1 archive
2.1.0 Aug 21, 2018 Go to the documentation of angel_serialize_generator 2.1.0 Download angel_serialize_generator 2.1.0 archive

All 34 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
57
Health:
Code health derived from static analysis. [more]
97
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
77
Learn more about scoring.

We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.13

Platforms

Detected platforms: other

Primary library: package:angel_serialize_generator/angel_serialize_generator.dart with components: io, build, mirrors.

Health suggestions

Fix lib/typescript.dart. (-1.49 points)

Analysis of lib/typescript.dart reported 3 hints:

line 6 col 61: Use = to separate a named parameter from its default value.

line 70 col 13: Use isEmpty instead of length

line 209 col 5: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

Fix lib/build_context.dart. (-0.50 points)

Analysis of lib/build_context.dart reported 1 hint:

line 37 col 22: Use = to separate a named parameter from its default value.

Fix lib/context.dart. (-0.50 points)

Analysis of lib/context.dart reported 1 hint:

line 57 col 30: Use = to separate a named parameter from its default value.

Fix lib/serialize.dart. (-0.50 points)

Analysis of lib/serialize.dart reported 1 hint:

line 6 col 53: Use = to separate a named parameter from its default value.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
analyzer >=0.27.1 <2.0.0 0.35.1
angel_model ^1.0.0 1.0.1
angel_serialize ^2.2.0 2.2.2+1
build >=0.12.0 <2.0.0 1.1.1
build_config >=0.3.0 <2.0.0 0.3.1+4
code_buffer ^1.0.0 1.0.1
code_builder ^3.0.0 3.2.0
meta ^1.0.0 1.1.7
path ^1.0.0 1.6.2
quiver ^2.0.0 2.0.1
recase ^2.0.0 2.0.1
source_gen ^0.9.0 0.9.4+1
Transitive dependencies
args 1.5.1
async 2.0.8
built_collection 4.1.0
built_value 6.3.0
charcode 1.1.2
convert 2.1.1
crypto 2.0.6
csslib 0.14.6
dart_style 1.2.3
fixnum 0.10.9
front_end 0.1.11
glob 1.1.7
html 0.13.3+3
json_annotation 2.0.0
kernel 0.3.11
logging 0.11.3+2
matcher 0.12.4
package_config 1.0.5
plugin 0.2.0+3
pub_semver 1.4.2
pubspec_parse 0.1.4
quiver_hashcode 2.0.0
source_span 1.5.4
stack_trace 1.9.3
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
utf 0.9.0+5
watcher 0.9.7+10
yaml 2.1.15
Dev dependencies
build_runner ^1.0.0
collection ^1.0.0 1.14.11
test ^1.0.0