Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support of Null Safety #49

Merged
merged 3 commits into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
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 @@ -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 &&
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);
});
}