diff --git a/CHANGELOG.md b/CHANGELOG.md index ad7c5bc1..e28d4188 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.0.2 +* `idAsInt` now uses `int.tryParse`. + # 1.0.1 * Add `idAsInt`. diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 00000000..c230cee7 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:pedantic/analysis_options.yaml +analyzer: + strong-mode: + implicit-casts: false \ No newline at end of file diff --git a/lib/angel_model.dart b/lib/angel_model.dart index c3290602..0694c33a 100644 --- a/lib/angel_model.dart +++ b/lib/angel_model.dart @@ -12,5 +12,5 @@ class Model { Model({this.id, this.createdAt, this.updatedAt}); /// Returns the [id], parsed as an [int]. - int get idAsInt => int.parse(id); + int get idAsInt => int.tryParse(id); } diff --git a/pubspec.yaml b/pubspec.yaml index bfa889ee..e751fa00 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,9 @@ name: angel_model -version: 1.0.1 +version: 1.0.2 description: Angel's basic data model class, no longer with the added weight of the whole framework. author: Tobe O homepage: https://github.com/angel-dart/model environment: sdk: ">=1.8.0 <3.0.0" +dev_dependencies: + pedantic: ^1.0.0