From 68c955125fb819eb0697decabc0d4fb92bf89d4f Mon Sep 17 00:00:00 2001 From: Yczar Date: Thu, 20 Apr 2023 16:52:01 +0100 Subject: [PATCH] chore: migrated code to null safety --- example/lib/main.dart | 2 +- example/pubspec.lock | 118 ++++++++++++++++++++----------- lib/model/forward_geocoding.dart | 80 ++++++++++----------- lib/model/reverse_geocoding.dart | 66 ++++++++--------- lib/src/MapboxGeocoding.dart | 10 ++- pubspec.lock | 63 +++++++++-------- pubspec.yaml | 7 +- 7 files changed, 192 insertions(+), 154 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 4a9e35f..eb282d3 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -67,7 +67,7 @@ class _MyHomePageState extends State { ), Text( getCity(41.0, 29.0), - style: Theme.of(context).textTheme.display1, + style: Theme.of(context).textTheme.titleLarge, ), ], ), diff --git a/example/pubspec.lock b/example/pubspec.lock index 174e247..dc3513a 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,58 +5,66 @@ packages: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.10.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.2.1" charcode: dependency: transitive description: name: charcode - url: "https://pub.dartlang.org" + sha256: abac3bd18780f688ff2b93914f7ed2d4e9405835cbed1f09298ef65e278f23a2 + url: "https://pub.dev" source: hosted version: "1.1.3" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + url: "https://pub.dev" source: hosted - version: "1.14.13" + version: "1.17.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: a937da4c006989739ceb4d10e3bd6cce64ca85d0fe287fc5b2b9f6ee757dcee6 + url: "https://pub.dev" source: hosted version: "0.1.3" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.3.1" flutter: dependency: "direct main" description: flutter @@ -71,49 +79,71 @@ packages: dependency: transitive description: name: http - url: "https://pub.dartlang.org" + sha256: "411262398b34f52b9baac4860a1aa6e4779037ba9289c19b4cd16928efa97a2b" + url: "https://pub.dev" source: hosted version: "0.12.2" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "9d2b0626e9e402fc98e6868360da8f256064d6c0b8e4c3edcca5e02fb0b95da9" + url: "https://pub.dev" source: hosted version: "3.1.4" + js: + dependency: transitive + description: + name: js + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.dev" + source: hosted + version: "0.6.5" mapbox_geocoding: dependency: "direct main" description: path: ".." relative: true source: path - version: "0.1.2" + version: "0.1.3" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + url: "https://pub.dev" source: hosted - version: "0.12.8" + version: "0.12.13" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + url: "https://pub.dev" source: hosted - version: "1.1.8" + version: "1.8.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.8.2" pedantic: dependency: transitive description: name: pedantic - url: "https://pub.dartlang.org" + sha256: bd877013a0ee53cd774e7b7f3ec1fbd44c94704ff36177f2f20e287228cbe2a2 + url: "https://pub.dev" source: hosted version: "1.9.0" sky_engine: @@ -125,57 +155,65 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.9.5" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + url: "https://pub.dev" source: hosted - version: "0.2.17" + version: "0.4.16" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: b41767fd0d6c2473e3ff61a05d3ab55578dae390d0b19bb35d1821e612faace6 + url: "https://pub.dev" source: hosted version: "1.2.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.0.8" + version: "2.1.4" sdks: - dart: ">=2.9.0-14.0.dev <3.0.0" + dart: ">=2.18.0 <3.0.0" diff --git a/lib/model/forward_geocoding.dart b/lib/model/forward_geocoding.dart index 638bdda..a5d39f0 100644 --- a/lib/model/forward_geocoding.dart +++ b/lib/model/forward_geocoding.dart @@ -1,16 +1,16 @@ ///The forward geocoding query type allows you to look up a single location by name and returns its geographic coordinates. class ForwardGeocoding { ///```"FeatureCollection"```, a GeoJSON type from the [GeoJSON specification](https://tools.ietf.org/html/rfc7946). - String type; + String? type; ///An array of space and punctuation-separated strings from the original query. - List query; + List? query; ///Returned features are ordered by ```relevance```. - List features; + List? features; ///A string that attributes the results of the Mapbox Geocoding API to Mapbox. - String attribution; + String? attribution; ForwardGeocoding({this.type, this.query, this.features, this.attribution}); @@ -18,9 +18,9 @@ class ForwardGeocoding { type = json['type']; query = json['query'].cast(); if (json['features'] != null) { - features = List(); + features = []; json['features'].forEach((v) { - features.add(Features.fromJson(v)); + features!.add(Features.fromJson(v)); }); } attribution = json['attribution']; @@ -31,7 +31,7 @@ class ForwardGeocoding { data['type'] = this.type; data['query'] = this.query; if (this.features != null) { - data['features'] = this.features.map((v) => v.toJson()).toList(); + data['features'] = this.features!.map((v) => v.toJson()).toList(); } data['attribution'] = this.attribution; return data; @@ -40,37 +40,37 @@ class ForwardGeocoding { class Features { ///A feature ID in the format ```{type}.{id}``` where ```{type}``` is the lowest hierarchy feature in the place_type field. The ```{id}``` suffix of the feature ID is unstable and may change within versions. - String id; + String? id; ///```"Feature"```, a GeoJSON type from the GeoJSON specification. - String type; + String? type; ///An array of feature types describing the feature. Options are ```country```, ```region```, ```postcode```, ```district```, ```place```, ```locality```, ```neighborhood```, ```address```, and ```poi```. Most features have only one type, but if the feature has multiple types, all applicable types will be listed in the array. (For example, Vatican City is a ```country```, ```region```, and ```place```.) - List placeType; + List? placeType; ///Indicates how well the returned feature matches the user's query on a scale from 0 to 1. 0 means the result does not match the query text at all, while 1 means the result fully matches the query text. You can use the relevance property to remove results that don’t fully match the query. Learn more about textual relevance in the [Search result prioritization](https://docs.mapbox.com/help/how-mapbox-works/geocoding/#search-result-prioritization) guide. - num relevance; + num? relevance; ///A string representing the feature in the requested language, if specified. - Properties properties; + Properties? properties; ///A string representing the feature in the requested language, if specified, and its full result hierarchy. - String text; + String? text; ///The coordinates of the feature’s center in the form ```[longitude,latitude]```. This may be the literal centroid of the feature’s geometry, or the center of human activity within the feature (for example, the downtown area of a city). - String placeName; + String? placeName; ///A bounding box array in the form ```[minX,minY,maxX,maxY]```. - List bbox; + List? bbox; ///An object describing the spatial geometry of the returned feature. - List center; + List? center; ///(Optional)A string of the house number for the returned address feature. Note that unlike the address property for poi features, this property is outside the properties object. - Geometry geometry; + Geometry? geometry; ///A bounding box array in the form ```[minX,minY,maxX,maxY]```. - List context; + List? context; Features( {this.id, @@ -89,8 +89,8 @@ class Features { id = json['id']; type = json['type']; if (json['place_type'] != null) { - placeType = List(); - json['place_type'].forEach((v) => placeType.add(v)); + placeType = []; + json['place_type'].forEach((v) => placeType!.add(v)); } relevance = json['relevance']; properties = json['properties'] != null @@ -99,18 +99,18 @@ class Features { text = json['text']; placeName = json['place_name']; if (json['bbox'] != null) { - bbox = List(); + bbox = []; json['bbox'].forEach((v) { - bbox.add(v); + bbox!.add(v); }); } center = json['center'].cast(); geometry = json['geometry'] != null ? Geometry.fromJson(json['geometry']) : null; if (json['context'] != null) { - context = List(); + context = []; json['context'].forEach((v) { - context.add(Context.fromJson(v)); + context!.add(Context.fromJson(v)); }); } } @@ -120,23 +120,23 @@ class Features { data['id'] = this.id; data['type'] = this.type; if (this.placeType != null) { - data['place_type'] = this.placeType.map((v) => v).toList(); + data['place_type'] = this.placeType!.map((v) => v).toList(); } data['relevance'] = this.relevance; if (this.properties != null) { - data['properties'] = this.properties.toJson(); + data['properties'] = this.properties!.toJson(); } data['text'] = this.text; data['place_name'] = this.placeName; if (this.bbox != null) { - data['bbox'] = this.bbox.map((v) => v).toList(); + data['bbox'] = this.bbox!.map((v) => v).toList(); } data['center'] = this.center; if (this.geometry != null) { - data['geometry'] = this.geometry.toJson(); + data['geometry'] = this.geometry!.toJson(); } if (this.context != null) { - data['context'] = this.context.map((v) => v.toJson()).toList(); + data['context'] = this.context!.map((v) => v.toJson()).toList(); } return data; } @@ -144,19 +144,19 @@ class Features { class Properties { ///The [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country and [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) region code for the returned feature. - String wikidata; + String? wikidata; ///Describes whether or not the feature is in the poi.landmark data type. This data type is deprecated, and this property will be present on all poi features for backwards compatibility reasons but will always be true. - bool landmark; + bool? landmark; ///A string of the full street address for the returned poi feature. Note that unlike the address property for address features, this property is inside the properties object. - String address; + String? address; ///A string of comma-separated categories for the returned poi feature. - String category; + String? category; ///The name of a suggested [Maki](https://www.mapbox.com/maki-icons/) icon to visualize a poi feature based on its category - String maki; + String? maki; Properties( {this.wikidata, this.landmark, this.address, this.category, this.maki}); @@ -182,10 +182,10 @@ class Properties { class Geometry { ///"Point", a GeoJSON type from the [GeoJSON specification](https://tools.ietf.org/html/rfc7946). - String type; + String? type; ///An array in the format ```[longitude,latitude]``` at the center of the specified bbox. - List coordinates; + List? coordinates; Geometry({this.type, this.coordinates}); @@ -203,14 +203,14 @@ class Geometry { } class Context { - String id; + String? id; ///The [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country and [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) region code for the returned feature. - String shortCode; + String? shortCode; ///The [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country and [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) region code for the returned feature. - String wikidata; - String text; + String? wikidata; + String? text; Context({this.id, this.shortCode, this.wikidata, this.text}); diff --git a/lib/model/reverse_geocoding.dart b/lib/model/reverse_geocoding.dart index 7fe56d5..c16d739 100644 --- a/lib/model/reverse_geocoding.dart +++ b/lib/model/reverse_geocoding.dart @@ -1,16 +1,16 @@ ///The reverse geocoding query type allows you to look up a single pair of coordinates and returns the geographic feature or features that exist at that location. class ReverseGeocoding { ///```"FeatureCollection"```, a GeoJSON type from the [GeoJSON specification](https://tools.ietf.org/html/rfc7946). - String type; + String? type; ///An array containing the coordinates being queried. - List query; + List? query; ///Returned features are ordered by index hierarchy, from most specific features to least specific features that overlap the queried coordinates. - List features; + List? features; ///A string that attributes the results of the Mapbox Geocoding API to Mapbox. - String attribution; + String? attribution; ReverseGeocoding({this.type, this.query, this.features, this.attribution}); @@ -18,9 +18,9 @@ class ReverseGeocoding { type = json['type']; query = json['query'].cast(); if (json['features'] != null) { - features = List(); + features = []; json['features'].forEach((v) { - features.add(Features.fromJson(v)); + features!.add(Features.fromJson(v)); }); } attribution = json['attribution']; @@ -31,7 +31,7 @@ class ReverseGeocoding { data['type'] = this.type; data['query'] = this.query; if (this.features != null) { - data['features'] = this.features.map((v) => v.toJson()).toList(); + data['features'] = this.features!.map((v) => v.toJson()).toList(); } data['attribution'] = this.attribution; return data; @@ -40,40 +40,40 @@ class ReverseGeocoding { class Features { ///A feature ID in the format ```{type}.{id}``` where ```{type}``` is the lowest hierarchy feature in the place_type field. The ```{id}``` suffix of the feature ID is unstable and may change within versions. - String id; + String? id; ///```"Feature"```, a GeoJSON type from the GeoJSON specification. - String type; + String? type; ///An array of feature types describing the feature. Options are ```country```, ```region```, ```postcode```, ```district```, ```place```, ```locality```, ```neighborhood```, ```address```, and ```poi```. Most features have only one type, but if the feature has multiple types, all applicable types will be listed in the array. (For example, Vatican City is a ```country```, ```region```, and ```place```.) - List placeType; + List? placeType; ///Indicates how well the returned feature matches the user's query on a scale from 0 to 1. 0 means the result does not match the query text at all, while 1 means the result fully matches the query text. You can use the relevance property to remove results that don’t fully match the query. Learn more about textual relevance in the [Search result prioritization](https://docs.mapbox.com/help/how-mapbox-works/geocoding/#search-result-prioritization) guide. - num relevance; + num? relevance; ///An object describing the feature. The properties object may change with data improvements. Your implementation should check for the presence of these values in a response before it attempts to use them. - Properties properties; + Properties? properties; ///A string representing the feature in the requested language, if specified. - String text; + String? text; ///A string representing the feature in the requested language, if specified, and its full result hierarchy. - String placeName; + String? placeName; ///The coordinates of the feature’s center in the form ```[longitude,latitude]```. This may be the literal centroid of the feature’s geometry, or the center of human activity within the feature (for example, the downtown area of a city). - List center; + List? center; ///An object describing the spatial geometry of the returned feature. - Geometry geometry; + Geometry? geometry; ///(Optional)A string of the house number for the returned address feature. Note that unlike the address property for poi features, this property is outside the properties object. - String address; + String? address; ///An array representing the hierarchy of encompassing parent features. Each parent feature may include any of the above properties. - List context; + List? context; ///A bounding box array in the form ```[minX,minY,maxX,maxY]```. - List bbox; + List? bbox; Features( {this.id, @@ -104,9 +104,9 @@ class Features { json['geometry'] != null ? Geometry.fromJson(json['geometry']) : null; address = json['address']; if (json['context'] != null) { - context = List(); + context = []; json['context'].forEach((v) { - context.add(Context.fromJson(v)); + context!.add(Context.fromJson(v)); }); } bbox = json['bbox'].cast(); @@ -119,17 +119,17 @@ class Features { data['place_type'] = this.placeType; data['relevance'] = this.relevance; if (this.properties != null) { - data['properties'] = this.properties.toJson(); + data['properties'] = this.properties!.toJson(); } data['text'] = this.text; data['place_name'] = this.placeName; data['center'] = this.center; if (this.geometry != null) { - data['geometry'] = this.geometry.toJson(); + data['geometry'] = this.geometry!.toJson(); } data['address'] = this.address; if (this.context != null) { - data['context'] = this.context.map((v) => v.toJson()).toList(); + data['context'] = this.context!.map((v) => v.toJson()).toList(); } data['bbox'] = this.bbox; return data; @@ -138,13 +138,13 @@ class Features { class Properties { ///A point accuracy metric for the returned address feature. Can be one of rooftop, parcel, point, interpolated, intersection, street. Note that this list is subject to change. - String accuracy; + String? accuracy; ///The [Wikidata](https://wikidata.org/) identifier for the returned feature. - String wikidata; + String? wikidata; ///The [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country and [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) region code for the returned feature. - String shortCode; + String? shortCode; Properties({this.accuracy, this.wikidata, this.shortCode}); @@ -165,10 +165,10 @@ class Properties { class Geometry { ///"Point", a GeoJSON type from the [GeoJSON specification](https://tools.ietf.org/html/rfc7946). - String type; + String? type; ///An array in the format ```[longitude,latitude]``` at the center of the specified bbox. - List coordinates; + List? coordinates; Geometry({this.type, this.coordinates}); @@ -186,14 +186,14 @@ class Geometry { } class Context { - String id; - String text; + String? id; + String? text; ///The [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country and [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) region code for the returned feature. - String wikidata; + String? wikidata; ///The [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country and [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) region code for the returned feature. - String shortCode; + String? shortCode; Context({this.id, this.text, this.wikidata, this.shortCode}); diff --git a/lib/src/MapboxGeocoding.dart b/lib/src/MapboxGeocoding.dart index 4627bbb..3fae9c9 100644 --- a/lib/src/MapboxGeocoding.dart +++ b/lib/src/MapboxGeocoding.dart @@ -17,14 +17,13 @@ class MapboxGeocoding { /// ///The accuracy of coordinates returned by a forward geocoding request can be impacted by how the addresses in the query are formatted. Learn more about address formatting best practices in the [Address geocoding format guide](https://docs.mapbox.com/help/troubleshooting/address-geocoding-format-guide/). String searchText, { - ///Specify whether to return autocomplete results (true, default) or not (false). When autocomplete is enabled, results will be included that start with the requested string, rather than just responses that match it exactly. For example, a query for India might return both India and Indiana with autocomplete enabled, but only India if it’s disabled. /// ///When autocomplete is enabled, each user keystroke counts as one request to the Geocoding API. For example, a search for "coff" would be reflected as four separate Geocoding API requests. To reduce the total requests sent, you can configure your application to only call the Geocoding API after a specific number of characters are typed. bool autoComplete = true, ///Limit results to only those contained within the supplied bounding box. Bounding boxes should be supplied as four numbers separated by commas, in ```minLon,minLat,maxLon,maxLat``` order. The bounding box cannot cross the 180th meridian. - List bbox, + List? bbox, ///Limit results to one country. Permitted values are [ISO 3166 alpha 2 country codes](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) separated by commas. String country = '', @@ -41,7 +40,7 @@ class MapboxGeocoding { int limit = 5, ///Bias the response to favor results that are closer to this location, provided as two comma-separated coordinates in ```longitude,latitude``` order. - List proximity, + List? proximity, ///Filter results to include only a subset (one or more) of the available feature types. Options are country, region, postcode, district, place, locality, neighborhood, address, and poi. Multiple options can be comma-separated. Note that poi.landmark is a deprecated type that, while still supported, returns the same data as is returned using the poi type. /// @@ -64,7 +63,7 @@ class MapboxGeocoding { } if (types.isNotEmpty) url += 'types=$types&'; url += 'access_token=$_apiKey'; - final response = await http.get(url); + final response = await http.get(Uri.parse(url)); if (response.statusCode == 200) { return ForwardGeocoding.fromJson(jsonDecode(response.body)); } else { @@ -81,7 +80,6 @@ class MapboxGeocoding { ///A longitude that specifies the location being queried. double lng, { - ///Limit results to one country. Permitted values are [ISO 3166 alpha 2 country codes](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) separated by commas. String country = '', @@ -108,7 +106,7 @@ class MapboxGeocoding { if (!limit.isNaN) if (limit > 10) limit = 10; if (types.isNotEmpty) url += 'types=$types&limit=${limit.toString()}&'; url += 'access_token=$_apiKey'; - final response = await http.get(url); + final response = await http.get(Uri.parse(url)); if (response.statusCode == 200) { return ReverseGeocoding.fromJson(jsonDecode(response.body)); } else { diff --git a/pubspec.lock b/pubspec.lock index b961da0..2bbdce5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,82 +1,85 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - charcode: + async: dependency: transitive description: - name: charcode - url: "https://pub.dartlang.org" + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "1.1.3" + version: "2.11.0" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" source: hosted - version: "1.14.13" + version: "1.17.1" http: dependency: "direct main" description: name: http - url: "https://pub.dartlang.org" + sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482" + url: "https://pub.dev" source: hosted - version: "0.12.2" + version: "0.13.5" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted - version: "3.1.4" + version: "4.0.2" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.2.3" + version: "1.9.1" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.7.0" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.2" + version: "1.8.3" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.10.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.1" sdks: - dart: ">=2.6.0 <3.0.0" + dart: ">=2.18.0 <3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 3b06754..12dba37 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,9 +5,8 @@ author: 'Berkay Oruç ' homepage: https://github.com/hexa-apps/mapbox_geocoding/ environment: - sdk: ">=2.1.0 <3.0.0" + sdk: '>=2.12.0 <3.0.0' -dependencies: - http: ^0.12.0+4 +dependencies: + http: ^0.13.5 -dev_dependencies: