diff --git a/CHANGELOG.md b/CHANGELOG.md index abf107ed..2db3b2dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Added code_buffer 2.0.0 * Added combinator 2.0.0 * Updated angel_route to 5.0.0 +* Updated angel_model to 3.0.0 # 3.0.0 (Non NNBD) * Changed Dart SDK requirements for all packages to ">=2.10.0 <3.0.0" diff --git a/packages/model/example/main.dart b/packages/model/example/main.dart index f6c5caef..5da94558 100644 --- a/packages/model/example/main.dart +++ b/packages/model/example/main.dart @@ -6,15 +6,15 @@ void main() { } class Todo extends Model { - String text; + String? text; - bool isComplete; + bool? isComplete; Todo( - {String id, + {String? id, this.text, this.isComplete, - DateTime createdAt, - DateTime updatedAt}) + DateTime? createdAt, + DateTime? updatedAt}) : super(id: id, createdAt: createdAt, updatedAt: updatedAt); } diff --git a/packages/model/lib/angel_model.dart b/packages/model/lib/angel_model.dart index d179fa54..3da6c1eb 100644 --- a/packages/model/lib/angel_model.dart +++ b/packages/model/lib/angel_model.dart @@ -1,16 +1,16 @@ /// Represents arbitrary data, with an associated ID and timestamps. class Model { /// A unique identifier corresponding to this item. - String id; + String? id; /// The time at which this item was created. - DateTime createdAt; + DateTime? createdAt; /// The last time at which this item was updated. - DateTime updatedAt; + DateTime? updatedAt; Model({this.id, this.createdAt, this.updatedAt}); /// Returns the [id], parsed as an [int]. - int get idAsInt => id == null ? null : int.tryParse(id); + int? get idAsInt => id == null ? null : int.tryParse(id!); } diff --git a/packages/model/pubspec.yaml b/packages/model/pubspec.yaml index 25b77639..47a00fd5 100644 --- a/packages/model/pubspec.yaml +++ b/packages/model/pubspec.yaml @@ -1,9 +1,9 @@ name: angel_model -version: 2.0.0 +version: 3.0.0 description: Angel's basic data model class, no longer with the added weight of the whole framework. author: Tobe O homepage: https://github.com/dukefirehawk/angel/packages/model environment: - sdk: ">=2.10.0 <3.0.0" + sdk: '>=2.12.0 <3.0.0' dev_dependencies: pedantic: ^1.11.0