Migrated angel_serialize

This commit is contained in:
thomashii@dukefirehawk.com 2021-05-02 13:23:44 +08:00
parent 31e52b6ad3
commit 1d3d10fb4f
8 changed files with 33 additions and 18 deletions

View file

@ -0,0 +1,2 @@
Tobe O <thosakwe@gmail.com>
Thomas Hii <thomashii@dukefirehawk.com>

View file

@ -1,3 +1,10 @@
# 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD
* Migrateed quiver_hashcode to quiver
# 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
# 2.2.3+3
* Add `exclude: true` to `super` call in `Exclude` constructor.

View file

@ -3,6 +3,6 @@ import 'package:angel_serialize/angel_serialize.dart';
@serializable
class _Todo {
String text;
bool completed;
String? text;
bool? completed;
}

View file

@ -2,7 +2,7 @@ export 'dart:convert' show json, Codec, Converter;
export 'package:angel_model/angel_model.dart';
export 'package:collection/collection.dart';
export 'package:meta/meta.dart' show required, Required;
export 'package:quiver_hashcode/hashcode.dart' show hashObjects;
export 'package:quiver/core.dart' show hashObjects;
/// Excludes a field from being excluded.
class Exclude extends SerializableField {
@ -35,19 +35,19 @@ class HasAlias extends SerializableField {
/// Attaches options to a field.
class SerializableField {
/// An alternative name for this field.
final String alias;
final String? alias;
/// A default for this field.
final defaultValue;
/// A custom serializer for this field.
final Symbol serializer;
final Symbol? serializer;
/// A custom serializer for this field.
final Symbol deserializer;
final Symbol? deserializer;
/// An error message to be printed when the provided value is invalid.
final String errorMessage;
final String? errorMessage;
/// Whether this field can be set to `null`.
final bool isNullable;
@ -67,7 +67,7 @@ class SerializableField {
///
/// Ex. If you have a field that serializes to a JSON string,
/// specify `serializesTo: String`.
final Type serializesTo;
final Type? serializesTo;
const SerializableField(
{this.alias,

View file

@ -1,18 +1,17 @@
name: angel_serialize
version: 3.0.0
version: 4.0.0
description: Static annotations powering Angel model serialization. Combine with angel_serialize_generator for flexible modeling.
author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/serialize
homepage: https://github.com/dukefirehawk/angel
publish_to: none
environment:
sdk: '>=2.10.0 <3.0.0'
sdk: '>=2.12.0 <3.0.0'
dependencies:
angel_model: #^1.0.0
angel_model:
git:
url: https://github.com/dukefirehawk/angel.git
ref: sdk-2.12.x
ref: sdk-2.12.x_nnbd
path: packages/model
collection: ^1.15.0
meta: ^1.3.0
pedantic: ^1.11.0
quiver_hashcode: ^2.0.0
quiver: ^3.0.1

View file

@ -0,0 +1,2 @@
Tobe O <thosakwe@gmail.com>
Thomas Hii <thomashii@dukefirehawk.com>

View file

@ -1,3 +1,9 @@
# 4.0.0
* Migrated to support Dart SDK 2.12.x NNBD
# 3.0.0
* Migrated to work with Dart SDK 2.12.x Non NNBD
# 2.5.0
* Support mutable models (again).
* Use `whereType()` instead of chaining `where()` and `cast()`.

View file

@ -1,8 +1,7 @@
name: angel_serialize_generator
version: 3.0.0
version: 4.0.0
description: Model serialization generators, designed for use with Angel. Combine with angel_serialize for flexible modeling.
author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/serialize
homepage: https://github.com/dukefirehawk/angel
publish_to: none
environment:
sdk: '>=2.7.0 <3.0.0'