Updated model

This commit is contained in:
thomashii 2021-08-02 20:26:00 +08:00
parent 9184dce6ab
commit c24b0095da
2 changed files with 2 additions and 1 deletions

View file

@ -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

View file

@ -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;
}