Skip to content

Commit

Permalink
fix: get first on empty list error in geocode_response; update depend…
Browse files Browse the repository at this point in the history
…ency; bump version
  • Loading branch information
Andrew Kurakov committed Feb 14, 2024
1 parent 23b1cd4 commit da7b382
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [2.2.1]
* Dependency update
* Fix get first on empty list error in geocode_response

## [2.2.0]

* Dart 3 support
Expand Down
2 changes: 1 addition & 1 deletion lib/src/models/response/geocode_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class GeocodeResponse with Comparer {
_$GeocodeResponseFromJson(json);

GeoObject? get _firstGeoObject =>
response?.geoObjectCollection?.featureMember?.first.geoObject;
response?.geoObjectCollection?.featureMember?.firstOrNull?.geoObject;

/// Первый адрес
Address? get firstAddress =>
Expand Down
12 changes: 6 additions & 6 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: yandex_geocoder
description: API to translate geographic coordinates into an address and vice versa
version: 2.2.0
version: 2.2.1
repository: https://github.com/MadBrains/Yandex-Geocoder-Flutter
issue_tracker: https://github.com/MadBrains/Yandex-Geocoder-Flutter/issues
homepage: https://madbrains.ru/
Expand All @@ -9,13 +9,13 @@ environment:
sdk: ">=3.0.0 <4.0.0"

dependencies:
collection: ^1.17.1
http: ^1.0.0
json_annotation: ^4.8.0
collection: ^1.18.0
http: ^1.2.0
json_annotation: ^4.8.1

dev_dependencies:
build_runner: ^2.4.0
build_runner: ^2.4.8
flutter_test:
sdk: flutter
json_serializable: ^6.6.1
json_serializable: ^6.7.1

0 comments on commit da7b382

Please sign in to comment.