diff --git a/example/pubspec.lock b/example/pubspec.lock index 7440e0d..f76b1e9 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -214,4 +214,4 @@ packages: version: "2.1.0-nullsafety.5" sdks: dart: ">=2.12.0-0.0 <3.0.0" - flutter: ">=1.22.0 <2.0.0" + flutter: ">=1.22.0 <2.0.0" \ No newline at end of file diff --git a/lib/src/PointLatLng.dart b/lib/src/PointLatLng.dart index 3375497..2b0364e 100644 --- a/lib/src/PointLatLng.dart +++ b/lib/src/PointLatLng.dart @@ -7,9 +7,7 @@ class PointLatLng { /// [longitude]. /// const PointLatLng(double latitude, double longitude) - : assert(latitude != null), - assert(longitude != null), - this.latitude = latitude, + : this.latitude = latitude, this.longitude = longitude; /// The latitude in degrees. diff --git a/lib/src/network_util.dart b/lib/src/network_util.dart index a37230d..c51b4a5 100644 --- a/lib/src/network_util.dart +++ b/lib/src/network_util.dart @@ -48,7 +48,7 @@ class NetworkUtil { //String url = uri.toString(); // print('GOOGLE MAPS URL: ' + url); var response = await http.get(uri); - if (response?.statusCode == 200) { + if (response.statusCode == 200) { var parsedJson = json.decode(response.body); result.status = parsedJson["status"]; if (parsedJson["status"]?.toLowerCase() == STATUS_OK && diff --git a/lib/src/utils/polyline_result.dart b/lib/src/utils/polyline_result.dart index 325470a..835b1a0 100644 --- a/lib/src/utils/polyline_result.dart +++ b/lib/src/utils/polyline_result.dart @@ -10,7 +10,7 @@ class PolylineResult { /// the api status retuned from google api /// /// returns OK if the api call is successful - String status; + String? status; /// list of decoded points List points; diff --git a/lib/src/utils/polyline_waypoint.dart b/lib/src/utils/polyline_waypoint.dart index 5f6aaef..a59b3f1 100644 --- a/lib/src/utils/polyline_waypoint.dart +++ b/lib/src/utils/polyline_waypoint.dart @@ -1,5 +1,3 @@ -import 'package:flutter/material.dart'; - /// description: /// project: flutter_polyline_points /// @package: @@ -19,7 +17,7 @@ class PolylineWayPoint { /// which has the effect of splitting the route into two routes bool stopOver; - PolylineWayPoint({@required this.location, this.stopOver = true}); + PolylineWayPoint({required this.location, this.stopOver = true}); @override String toString() { diff --git a/pubspec.yaml b/pubspec.yaml index ddeca72..a30eb04 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.2.6 homepage: https://github.com/Dammyololade/flutter_polyline_points environment: - sdk: ">=2.1.0 <3.0.0" + sdk: '>=2.12.0 <3.0.0' dependencies: flutter: diff --git a/test/flutter_polyline_points_test.dart b/test/flutter_polyline_points_test.dart index c0d68aa..117bc40 100644 --- a/test/flutter_polyline_points_test.dart +++ b/test/flutter_polyline_points_test.dart @@ -21,7 +21,6 @@ void main() { polylinePoints.decodePolyline("_p~iF~ps|U_ulLnnqC_mqNvxq`@"); print("Answer ---- "); print(points); - assert(points != null); assert(points.length > 0); }); }