Updated model
This commit is contained in:
parent
de18c82e66
commit
2643436d62
3 changed files with 4 additions and 5 deletions
|
@ -3,7 +3,6 @@
|
|||
## 3.0.2
|
||||
|
||||
* Updated README
|
||||
* Updated `id` to be `required`
|
||||
* Updated `idAsInt` to return `-1` instead of `null` for invalid id
|
||||
|
||||
## 3.0.1
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
/// Represents arbitrary data, with an associated ID and timestamps.
|
||||
class Model {
|
||||
/// A unique identifier corresponding to this item.
|
||||
String id;
|
||||
String? id;
|
||||
|
||||
String? error;
|
||||
|
||||
|
@ -13,8 +13,8 @@ class Model {
|
|||
/// The last time at which this item was updated.
|
||||
DateTime? updatedAt;
|
||||
|
||||
Model({required this.id, this.createdAt, this.updatedAt});
|
||||
Model({this.id, this.createdAt, this.updatedAt});
|
||||
|
||||
/// Returns the [id], parsed as an [int].
|
||||
int get idAsInt => int.tryParse(id) ?? -1;
|
||||
int get idAsInt => id != null ? int.tryParse(id!) ?? -1 : -1;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: angel3_model
|
||||
version: 3.0.1
|
||||
version: 3.0.2
|
||||
description: Angel3 basic data model class, no longer with the added weight of the whole framework.
|
||||
homepage: https://angel3-framework.web.app/
|
||||
repository: https://github.com/dukefirehawk/angel/tree/angel3/packages/model
|
||||
|
|
Loading…
Reference in a new issue