Skip to content

Commit

Permalink
Merge pull request #49 from bhavin-concetto/null_safety_merge
Browse files Browse the repository at this point in the history
Added support of Null Safety
  • Loading branch information
Dammyololade authored Mar 22, 2021
2 parents fc90194 + 7149050 commit 45d3430
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,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"
4 changes: 1 addition & 3 deletions lib/src/PointLatLng.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/network_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class NetworkUtil {

// 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 &&
Expand Down
2 changes: 1 addition & 1 deletion lib/src/utils/polyline_result.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<PointLatLng> points;
Expand Down
4 changes: 1 addition & 3 deletions lib/src/utils/polyline_waypoint.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'package:flutter/material.dart';

/// description:
/// project: flutter_polyline_points
/// @package:
Expand All @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion test/flutter_polyline_points_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}

0 comments on commit 45d3430

Please sign in to comment.