Updated model
This commit is contained in:
parent
9184dce6ab
commit
c24b0095da
2 changed files with 2 additions and 1 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
* Updated README
|
||||
* Updated `id` to be `required`
|
||||
* Updated `idAsInt` to return `-1` instead of `null` for invalid id
|
||||
|
||||
## 3.0.1
|
||||
|
||||
|
|
|
@ -16,5 +16,5 @@ class Model {
|
|||
Model({required this.id, this.createdAt, this.updatedAt});
|
||||
|
||||
/// Returns the [id], parsed as an [int].
|
||||
int get idAsInt => int.tryParse(id) ?? 0;
|
||||
int get idAsInt => int.tryParse(id) ?? -1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue