Skip to content

Commit

Permalink
* Updated dependencies
Browse files Browse the repository at this point in the history
* Updated linter warnings
* Updated version
  • Loading branch information
rithik-dev committed Jun 7, 2022
1 parent 2571c92 commit daacc74
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 49 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [1.0.2] - 07/06/2022

* Updated dependencies
* Updated linter warnings

## [1.0.1] - 26/01/2022

* Updated license
Expand Down
29 changes: 18 additions & 11 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
version: "1.16.0"
dio:
dependency: transitive
description:
name: dio
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.4"
version: "4.0.6"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -80,7 +80,7 @@ packages:
name: google_maps_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.1.7"
google_maps_flutter_platform_interface:
dependency: transitive
description:
Expand All @@ -94,7 +94,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.0"
version: "1.0.2"
http_parser:
dependency: transitive
description:
Expand All @@ -109,6 +109,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4"
meta:
dependency: transitive
description:
Expand All @@ -122,7 +129,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
plugin_platform_interface:
dependency: transitive
description:
Expand All @@ -141,7 +148,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.8.2"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -183,7 +190,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.3"
version: "0.4.9"
typed_data:
dependency: transitive
description:
Expand All @@ -197,7 +204,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.1.2"
sdks:
dart: ">=2.14.0 <3.0.0"
flutter: ">=2.5.0"
dart: ">=2.17.0-0 <3.0.0"
flutter: ">=2.8.0"
1 change: 1 addition & 0 deletions lib/src/main_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ class GoogleMapsWidget extends StatefulWidget {
final CameraTargetBounds cameraTargetBounds;

@override
// ignore: library_private_types_in_public_api
_GoogleMapsWidgetState createState() => _GoogleMapsWidgetState();
}

Expand Down
6 changes: 3 additions & 3 deletions lib/src/models/direction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Direction {
/// Takes in an [encoded] polyline string from the
/// api response and parses the given string in a [List] of [LatLng].
static List<LatLng> _decodePolyline(String encoded) {
List<LatLng> _polyLines = [];
List<LatLng> polyLines = [];
int index = 0, len = encoded.length;
int lat = 0, lng = 0;

Expand All @@ -85,9 +85,9 @@ class Direction {
int dLng = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
lng += dLng;
final p = LatLng((lat / 1E5).toDouble(), (lng / 1E5).toDouble());
_polyLines.add(p);
polyLines.add(p);
}
return _polyLines;
return polyLines;
}

/// Private constructor for [Direction] which receives a map from the
Expand Down
28 changes: 14 additions & 14 deletions lib/src/models/marker_icon_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,39 +68,39 @@ class MarkerIconInfo {
targetHeight: size.height.toInt(),
);
FrameInfo fi = await codec.getNextFrame();
final _bytes = (await fi.image.toByteData(format: ImageByteFormat.png))!
final bytes = (await fi.image.toByteData(format: ImageByteFormat.png))!
.buffer
.asUint8List();

return BitmapDescriptor.fromBytes(_bytes);
return BitmapDescriptor.fromBytes(bytes);
}

/// Creates a [BitmapDescriptor] from a material [Icon].
static Future<BitmapDescriptor> _getMarkerFromMaterialIcon({
required Icon icon,
}) async {
final iconData = icon.icon!;
final _pictureRecorder = PictureRecorder();
final _canvas = Canvas(_pictureRecorder);
final _textPainter = TextPainter(textDirection: TextDirection.ltr);
final _iconStr = String.fromCharCode(iconData.codePoint);
final pictureRecorder = PictureRecorder();
final canvas = Canvas(pictureRecorder);
final textPainter = TextPainter(textDirection: TextDirection.ltr);
final iconStr = String.fromCharCode(iconData.codePoint);

_textPainter.text = TextSpan(
text: _iconStr,
textPainter.text = TextSpan(
text: iconStr,
style: TextStyle(
letterSpacing: 0.0,
fontSize: 48.0,
fontFamily: iconData.fontFamily,
color: icon.color,
),
);
_textPainter.layout();
_textPainter.paint(_canvas, const Offset(0.0, 0.0));
textPainter.layout();
textPainter.paint(canvas, const Offset(0.0, 0.0));

final _picture = _pictureRecorder.endRecording();
final _image = await _picture.toImage(48, 48);
final _bytes = await _image.toByteData(format: ImageByteFormat.png);
final picture = pictureRecorder.endRecording();
final image = await picture.toImage(48, 48);
final bytes = await image.toByteData(format: ImageByteFormat.png);

return BitmapDescriptor.fromBytes(_bytes!.buffer.asUint8List());
return BitmapDescriptor.fromBytes(bytes!.buffer.asUint8List());
}
}
10 changes: 5 additions & 5 deletions lib/src/services/maps_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ class MapsService {
Set<Polyline> get polylines => _polylines;

/// Sets [GoogleMapController] from [GoogleMap] callback to [_mapController].
void setController(GoogleMapController _controller) {
_mapController = _controller;
void setController(GoogleMapController controller) {
_mapController = controller;
}

/// Whether to show the source marker at [_sourceLatLng].
Expand Down Expand Up @@ -200,17 +200,17 @@ class MapsService {
destination: _destinationLatLng,
);

final _polylineCoordinates = <LatLng>[];
final polylineCoordinates = <LatLng>[];

if (result != null && result.polylinePoints.isNotEmpty) {
_polylineCoordinates.addAll(result.polylinePoints);
polylineCoordinates.addAll(result.polylinePoints);
}

final polyline = Polyline(
polylineId: const PolylineId("poly_line"),
color: _routeColor ?? Constants.kRouteColor,
width: _routeWidth ?? Constants.kRouteWidth,
points: _polylineCoordinates,
points: polylineCoordinates,
);

_polylines.add(polyline);
Expand Down
31 changes: 19 additions & 12 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
version: "1.16.0"
dio:
dependency: "direct main"
description:
name: dio
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.4"
version: "4.0.6"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -68,7 +68,7 @@ packages:
name: flutter_lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
version: "2.0.1"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
Expand All @@ -87,7 +87,7 @@ packages:
name: google_maps_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.1.7"
google_maps_flutter_platform_interface:
dependency: transitive
description:
Expand All @@ -108,14 +108,21 @@ packages:
name: lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "2.0.0"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4"
meta:
dependency: transitive
description:
Expand All @@ -129,7 +136,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
plugin_platform_interface:
dependency: transitive
description:
Expand All @@ -148,7 +155,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.8.2"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -190,7 +197,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.3"
version: "0.4.9"
typed_data:
dependency: transitive
description:
Expand All @@ -204,7 +211,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.1.2"
sdks:
dart: ">=2.14.0 <3.0.0"
flutter: ">=2.5.0"
dart: ">=2.17.0-206.0.dev <3.0.0"
flutter: ">=2.8.0"
9 changes: 5 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: google_maps_widget
description: A Flutter package which can be used to make polylines(route) from a source to a destination, and also handle a driver's realtime location (if any) on the map.
version: 1.0.1
version: 1.0.2
homepage: https://github.com/rithik-dev/google_maps_widget

environment:
Expand All @@ -10,13 +10,14 @@ environment:
dependencies:
flutter:
sdk: flutter
google_maps_flutter: ^2.1.1
dio: ^4.0.4

google_maps_flutter: ^2.1.7
dio: ^4.0.6

dev_dependencies:
flutter_test:
sdk: flutter

flutter_lints: ^1.0.4
flutter_lints: ^2.0.1

flutter:

0 comments on commit daacc74

Please sign in to comment.