From 208e46ce89c4b23867068364a347f8463236c896 Mon Sep 17 00:00:00 2001 From: Maurice Parrish Date: Mon, 25 Nov 2019 12:51:24 -0800 Subject: [PATCH 1/5] Documentation for maps --- packages/google_maps_flutter/lib/src/camera.dart | 6 ++++++ packages/google_maps_flutter/lib/src/controller.dart | 4 ++++ packages/google_maps_flutter/lib/src/google_map.dart | 9 +++++++++ packages/google_maps_flutter/lib/src/location.dart | 1 + 4 files changed, 20 insertions(+) diff --git a/packages/google_maps_flutter/lib/src/camera.dart b/packages/google_maps_flutter/lib/src/camera.dart index 78d624b76f50..c92b0ef2fcfe 100644 --- a/packages/google_maps_flutter/lib/src/camera.dart +++ b/packages/google_maps_flutter/lib/src/camera.dart @@ -51,6 +51,9 @@ class CameraPosition { /// will be silently clamped to the supported range. final double zoom; + /// Serializes [CameraPosition]. + /// + /// Mainly for internal use when calling [CameraUpdate.newCameraPosition]. dynamic toMap() => { 'bearing': bearing, 'target': target._toJson(), @@ -58,6 +61,9 @@ class CameraPosition { 'zoom': zoom, }; + /// Deserializes [CameraPosition] from a map. + /// + /// Mainly for internal use. static CameraPosition fromMap(dynamic json) { if (json == null) { return null; diff --git a/packages/google_maps_flutter/lib/src/controller.dart b/packages/google_maps_flutter/lib/src/controller.dart index 4ef8956c581a..616f5ac74a95 100644 --- a/packages/google_maps_flutter/lib/src/controller.dart +++ b/packages/google_maps_flutter/lib/src/controller.dart @@ -14,6 +14,10 @@ class GoogleMapController { channel.setMethodCallHandler(_handleMethodCall); } + /// Initialize control of a [GoogleMap] with [id]. + /// + /// Mainly for internal use when instantiating a [GoogleMapController] passed + /// in [GoogleMap.onMapCreated] callback. static Future init( int id, CameraPosition initialCameraPosition, diff --git a/packages/google_maps_flutter/lib/src/google_map.dart b/packages/google_maps_flutter/lib/src/google_map.dart index fa5c3fdac490..fe09a2b8589f 100644 --- a/packages/google_maps_flutter/lib/src/google_map.dart +++ b/packages/google_maps_flutter/lib/src/google_map.dart @@ -4,6 +4,10 @@ part of google_maps_flutter; +/// Callback method for when the map is ready to be used. +/// +/// Pass to [GoogleMap.onMapCreated] to receive a [GoogleMapController] when the +/// map is created. typedef void MapCreatedCallback(GoogleMapController controller); /// Callback that receives updates to the camera position. @@ -14,6 +18,7 @@ typedef void MapCreatedCallback(GoogleMapController controller); /// This is used in [GoogleMap.onCameraMove]. typedef void CameraPositionCallback(CameraPosition position); +/// A widget which displays a map with data obtained from the Google Maps service. class GoogleMap extends StatefulWidget { const GoogleMap({ Key key, @@ -48,6 +53,9 @@ class GoogleMap extends StatefulWidget { }) : assert(initialCameraPosition != null), super(key: key); + /// Callback method for when the map is ready to be used. + /// + /// Used to receive a [GoogleMapController] for this [GoogleMap]. final MapCreatedCallback onMapCreated; /// The initial position of the map's camera. @@ -179,6 +187,7 @@ class GoogleMap extends StatefulWidget { /// were not claimed by any other gesture recognizer. final Set> gestureRecognizers; + /// Creates a [State] for this [GoogleMap]. @override State createState() => _GoogleMapState(); } diff --git a/packages/google_maps_flutter/lib/src/location.dart b/packages/google_maps_flutter/lib/src/location.dart index f0c6b623ab71..3d1452a2d005 100644 --- a/packages/google_maps_flutter/lib/src/location.dart +++ b/packages/google_maps_flutter/lib/src/location.dart @@ -95,6 +95,7 @@ class LatLngBounds { } } + /// Converts a list to [LatLngBounds]. @visibleForTesting static LatLngBounds fromList(dynamic json) { if (json == null) { From edcc3254994f525e2483628f5d3b6634713ba06c Mon Sep 17 00:00:00 2001 From: Maurice Parrish Date: Mon, 25 Nov 2019 12:52:05 -0800 Subject: [PATCH 2/5] Version bump --- packages/google_maps_flutter/CHANGELOG.md | 4 ++++ packages/google_maps_flutter/pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/google_maps_flutter/CHANGELOG.md b/packages/google_maps_flutter/CHANGELOG.md index 6ea04694815a..ef3d38ca8a53 100644 --- a/packages/google_maps_flutter/CHANGELOG.md +++ b/packages/google_maps_flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.21+12 + +* Add documentation. + ## 0.5.21+11 * Define clang module for iOS, fix analyzer warnings. diff --git a/packages/google_maps_flutter/pubspec.yaml b/packages/google_maps_flutter/pubspec.yaml index fc683bb1bba6..320e942bf208 100644 --- a/packages/google_maps_flutter/pubspec.yaml +++ b/packages/google_maps_flutter/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter description: A Flutter plugin for integrating Google Maps in iOS and Android applications. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter -version: 0.5.21+11 +version: 0.5.21+12 dependencies: flutter: From 1000b16373251fee151d42988bfd987e3a4b2175 Mon Sep 17 00:00:00 2001 From: Maurice Parrish Date: Mon, 25 Nov 2019 17:02:07 -0800 Subject: [PATCH 3/5] Remove analysis_options --- packages/google_maps_flutter/analysis_options.yaml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 packages/google_maps_flutter/analysis_options.yaml diff --git a/packages/google_maps_flutter/analysis_options.yaml b/packages/google_maps_flutter/analysis_options.yaml deleted file mode 100644 index d4ccef63f1d1..000000000000 --- a/packages/google_maps_flutter/analysis_options.yaml +++ /dev/null @@ -1,11 +0,0 @@ -# This is a temporary file to allow us to land a new set of linter rules in a -# series of manageable patches instead of one gigantic PR. It disables some of -# the new lints that are already failing on this plugin, for this plugin. It -# should be deleted and the failing lints addressed as soon as possible. - -include: ../../analysis_options.yaml - -analyzer: - errors: - public_member_api_docs: ignore - unawaited_futures: ignore From faae6a636d239f8f7e4482da20e457b1fe30b4e7 Mon Sep 17 00:00:00 2001 From: Maurice Parrish Date: Tue, 26 Nov 2019 12:43:39 -0800 Subject: [PATCH 4/5] documentation --- .../example/lib/animate_camera.dart | 2 ++ .../google_maps_flutter/example/lib/main.dart | 2 ++ .../example/lib/map_click.dart | 2 ++ .../example/lib/map_coordinates.dart | 2 ++ .../example/lib/map_ui.dart | 2 ++ .../example/lib/marker_icons.dart | 2 ++ .../example/lib/move_camera.dart | 2 ++ .../example/lib/padding.dart | 2 ++ .../google_maps_flutter/example/lib/page.dart | 2 ++ .../example/lib/place_circle.dart | 2 ++ .../example/lib/place_marker.dart | 2 ++ .../example/lib/place_polygon.dart | 2 ++ .../example/lib/place_polyline.dart | 2 ++ .../example/lib/scrolling_map.dart | 2 ++ .../google_maps_flutter/lib/src/bitmap.dart | 19 +++++++++++++++++++ .../google_maps_flutter/lib/src/camera.dart | 11 ++++++++--- .../google_maps_flutter/lib/src/circle.dart | 2 ++ .../lib/src/controller.dart | 3 +++ .../lib/src/google_map.dart | 8 ++++++++ .../google_maps_flutter/lib/src/marker.dart | 5 +++++ .../lib/src/pattern_item.dart | 1 + .../google_maps_flutter/lib/src/polygon.dart | 2 ++ .../google_maps_flutter/lib/src/polyline.dart | 4 ++++ .../lib/src/screen_coordinate.dart | 4 ++++ packages/google_maps_flutter/lib/src/ui.dart | 5 +++++ 25 files changed, 89 insertions(+), 3 deletions(-) diff --git a/packages/google_maps_flutter/example/lib/animate_camera.dart b/packages/google_maps_flutter/example/lib/animate_camera.dart index fe4283d7bb18..f131c13a1730 100644 --- a/packages/google_maps_flutter/example/lib/animate_camera.dart +++ b/packages/google_maps_flutter/example/lib/animate_camera.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// ignore_for_file: public_member_api_docs + import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; diff --git a/packages/google_maps_flutter/example/lib/main.dart b/packages/google_maps_flutter/example/lib/main.dart index c082f188ff91..f4b8776559ec 100644 --- a/packages/google_maps_flutter/example/lib/main.dart +++ b/packages/google_maps_flutter/example/lib/main.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// ignore_for_file: public_member_api_docs + import 'package:flutter/material.dart'; import 'animate_camera.dart'; import 'map_click.dart'; diff --git a/packages/google_maps_flutter/example/lib/map_click.dart b/packages/google_maps_flutter/example/lib/map_click.dart index a73595d56503..96d239be8890 100644 --- a/packages/google_maps_flutter/example/lib/map_click.dart +++ b/packages/google_maps_flutter/example/lib/map_click.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// ignore_for_file: public_member_api_docs + import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; diff --git a/packages/google_maps_flutter/example/lib/map_coordinates.dart b/packages/google_maps_flutter/example/lib/map_coordinates.dart index fd707fba9313..dcc08f23c3e3 100644 --- a/packages/google_maps_flutter/example/lib/map_coordinates.dart +++ b/packages/google_maps_flutter/example/lib/map_coordinates.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// ignore_for_file: public_member_api_docs + import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; diff --git a/packages/google_maps_flutter/example/lib/map_ui.dart b/packages/google_maps_flutter/example/lib/map_ui.dart index c20aaf2be544..2a84e71c81a3 100644 --- a/packages/google_maps_flutter/example/lib/map_ui.dart +++ b/packages/google_maps_flutter/example/lib/map_ui.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// ignore_for_file: public_member_api_docs + import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:flutter/services.dart' show rootBundle; diff --git a/packages/google_maps_flutter/example/lib/marker_icons.dart b/packages/google_maps_flutter/example/lib/marker_icons.dart index 7472e8f8a175..d22e2fbbc38b 100644 --- a/packages/google_maps_flutter/example/lib/marker_icons.dart +++ b/packages/google_maps_flutter/example/lib/marker_icons.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// ignore_for_file: public_member_api_docs + import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; diff --git a/packages/google_maps_flutter/example/lib/move_camera.dart b/packages/google_maps_flutter/example/lib/move_camera.dart index 299ac4b7cffc..5b52836e4d81 100644 --- a/packages/google_maps_flutter/example/lib/move_camera.dart +++ b/packages/google_maps_flutter/example/lib/move_camera.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// ignore_for_file: public_member_api_docs + import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; diff --git a/packages/google_maps_flutter/example/lib/padding.dart b/packages/google_maps_flutter/example/lib/padding.dart index 6c1fe38dbf3a..a9e4e54b0667 100644 --- a/packages/google_maps_flutter/example/lib/padding.dart +++ b/packages/google_maps_flutter/example/lib/padding.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// ignore_for_file: public_member_api_docs + import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'page.dart'; diff --git a/packages/google_maps_flutter/example/lib/page.dart b/packages/google_maps_flutter/example/lib/page.dart index c9f834b77e53..32f3645c4ef9 100644 --- a/packages/google_maps_flutter/example/lib/page.dart +++ b/packages/google_maps_flutter/example/lib/page.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// ignore_for_file: public_member_api_docs + import 'package:flutter/material.dart'; abstract class Page extends StatelessWidget { diff --git a/packages/google_maps_flutter/example/lib/place_circle.dart b/packages/google_maps_flutter/example/lib/place_circle.dart index fb9436acac74..b44413a8283a 100644 --- a/packages/google_maps_flutter/example/lib/place_circle.dart +++ b/packages/google_maps_flutter/example/lib/place_circle.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// ignore_for_file: public_member_api_docs + import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; diff --git a/packages/google_maps_flutter/example/lib/place_marker.dart b/packages/google_maps_flutter/example/lib/place_marker.dart index f38ee4320867..ce0f9d436699 100644 --- a/packages/google_maps_flutter/example/lib/place_marker.dart +++ b/packages/google_maps_flutter/example/lib/place_marker.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// ignore_for_file: public_member_api_docs + import 'dart:async'; import 'dart:math'; import 'dart:ui'; diff --git a/packages/google_maps_flutter/example/lib/place_polygon.dart b/packages/google_maps_flutter/example/lib/place_polygon.dart index 25818c73e3b7..e78fd1c75bee 100644 --- a/packages/google_maps_flutter/example/lib/place_polygon.dart +++ b/packages/google_maps_flutter/example/lib/place_polygon.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// ignore_for_file: public_member_api_docs + import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; diff --git a/packages/google_maps_flutter/example/lib/place_polyline.dart b/packages/google_maps_flutter/example/lib/place_polyline.dart index e2b0d3f8e393..52fc22f45552 100644 --- a/packages/google_maps_flutter/example/lib/place_polyline.dart +++ b/packages/google_maps_flutter/example/lib/place_polyline.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// ignore_for_file: public_member_api_docs + import 'dart:io' show Platform; import 'package:flutter/material.dart'; diff --git a/packages/google_maps_flutter/example/lib/scrolling_map.dart b/packages/google_maps_flutter/example/lib/scrolling_map.dart index 9597e46dc266..30359c9d6a4d 100644 --- a/packages/google_maps_flutter/example/lib/scrolling_map.dart +++ b/packages/google_maps_flutter/example/lib/scrolling_map.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// ignore_for_file: public_member_api_docs + import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; diff --git a/packages/google_maps_flutter/lib/src/bitmap.dart b/packages/google_maps_flutter/lib/src/bitmap.dart index e239956730c9..ca6ed6eb138a 100644 --- a/packages/google_maps_flutter/lib/src/bitmap.dart +++ b/packages/google_maps_flutter/lib/src/bitmap.dart @@ -10,15 +10,34 @@ part of google_maps_flutter; class BitmapDescriptor { const BitmapDescriptor._(this._json); + /// Convenience hue value representing red. static const double hueRed = 0.0; + + /// Convenience hue value representing orange. static const double hueOrange = 30.0; + + /// Convenience hue value representing yellow. static const double hueYellow = 60.0; + + /// Convenience hue value representing green. static const double hueGreen = 120.0; + + /// Convenience hue value representing cyan. static const double hueCyan = 180.0; + + /// Convenience hue value representing azure. static const double hueAzure = 210.0; + + /// Convenience hue value representing blue. static const double hueBlue = 240.0; + + /// Convenience hue value representing violet. static const double hueViolet = 270.0; + + /// Convenience hue value representing magenta. static const double hueMagenta = 300.0; + + /// Convenience hue value representing rose. static const double hueRose = 330.0; /// Creates a BitmapDescriptor that refers to the default marker image. diff --git a/packages/google_maps_flutter/lib/src/camera.dart b/packages/google_maps_flutter/lib/src/camera.dart index c92b0ef2fcfe..043d0f8c9d78 100644 --- a/packages/google_maps_flutter/lib/src/camera.dart +++ b/packages/google_maps_flutter/lib/src/camera.dart @@ -4,10 +4,15 @@ part of google_maps_flutter; -/// The position of the map "camera", the view point from which the world is -/// shown in the map view. Aggregates the camera's [target] geographical -/// location, its [zoom] level, [tilt] angle, and [bearing]. +/// The position of the map "camera", the view point from which the world is shown in the map view. +/// +/// Aggregates the camera's [target] geographical location, its [zoom] level, +/// [tilt] angle, and [bearing]. class CameraPosition { + /// Creates a immutable representation of the [GoogleMap] camera. + /// + /// [AssertionError] is thrown if [bearing], [target], [tilt], or [zoom] are + /// null. const CameraPosition({ this.bearing = 0.0, @required this.target, diff --git a/packages/google_maps_flutter/lib/src/circle.dart b/packages/google_maps_flutter/lib/src/circle.dart index 1ab966cc6957..0de675d2b40b 100644 --- a/packages/google_maps_flutter/lib/src/circle.dart +++ b/packages/google_maps_flutter/lib/src/circle.dart @@ -9,6 +9,7 @@ part of google_maps_flutter; /// This does not have to be globally unique, only unique among the list. @immutable class CircleId { + /// Creates an immutable identifier for a [Circle]. CircleId(this.value) : assert(value != null); /// value of the [CircleId]. @@ -34,6 +35,7 @@ class CircleId { /// Draws a circle on the map. @immutable class Circle { + /// Creates an immutable representation of a [Circle] to draw on [GoogleMap]. const Circle({ @required this.circleId, this.consumeTapEvents = false, diff --git a/packages/google_maps_flutter/lib/src/controller.dart b/packages/google_maps_flutter/lib/src/controller.dart index 616f5ac74a95..c6c64a5365a8 100644 --- a/packages/google_maps_flutter/lib/src/controller.dart +++ b/packages/google_maps_flutter/lib/src/controller.dart @@ -34,6 +34,9 @@ class GoogleMapController { ); } + /// Used to communicate with the native platform. + /// + /// Accessible only for testing. @visibleForTesting final MethodChannel channel; diff --git a/packages/google_maps_flutter/lib/src/google_map.dart b/packages/google_maps_flutter/lib/src/google_map.dart index fe09a2b8589f..d1f85a0d83ac 100644 --- a/packages/google_maps_flutter/lib/src/google_map.dart +++ b/packages/google_maps_flutter/lib/src/google_map.dart @@ -20,6 +20,9 @@ typedef void CameraPositionCallback(CameraPosition position); /// A widget which displays a map with data obtained from the Google Maps service. class GoogleMap extends StatefulWidget { + /// Creates a widget displaying data from Google Maps services. + /// + /// [AssertionError] will be thrown if [initialCameraPosition] is null; const GoogleMap({ Key key, @required this.initialCameraPosition, @@ -262,12 +265,14 @@ class _GoogleMapState extends State { return; } final GoogleMapController controller = await _controller.future; + // ignore: unawaited_futures controller._updateMapOptions(updates); _googleMapOptions = newOptions; } void _updateMarkers() async { final GoogleMapController controller = await _controller.future; + // ignore: unawaited_futures controller._updateMarkers( _MarkerUpdates.from(_markers.values.toSet(), widget.markers)); _markers = _keyByMarkerId(widget.markers); @@ -275,6 +280,7 @@ class _GoogleMapState extends State { void _updatePolygons() async { final GoogleMapController controller = await _controller.future; + // ignore: unawaited_futures controller._updatePolygons( _PolygonUpdates.from(_polygons.values.toSet(), widget.polygons)); _polygons = _keyByPolygonId(widget.polygons); @@ -282,6 +288,7 @@ class _GoogleMapState extends State { void _updatePolylines() async { final GoogleMapController controller = await _controller.future; + // ignore: unawaited_futures controller._updatePolylines( _PolylineUpdates.from(_polylines.values.toSet(), widget.polylines)); _polylines = _keyByPolylineId(widget.polylines); @@ -289,6 +296,7 @@ class _GoogleMapState extends State { void _updateCircles() async { final GoogleMapController controller = await _controller.future; + // ignore: unawaited_futures controller._updateCircles( _CircleUpdates.from(_circles.values.toSet(), widget.circles)); _circles = _keyByCircleId(widget.circles); diff --git a/packages/google_maps_flutter/lib/src/marker.dart b/packages/google_maps_flutter/lib/src/marker.dart index 5d4d4f393c33..5690cddcbe06 100644 --- a/packages/google_maps_flutter/lib/src/marker.dart +++ b/packages/google_maps_flutter/lib/src/marker.dart @@ -13,6 +13,7 @@ dynamic _offsetToJson(Offset offset) { /// Text labels for a [Marker] info window. class InfoWindow { + /// Creates an immutable representation of a label on for [Marker]. const InfoWindow({ this.title, this.snippet, @@ -100,6 +101,7 @@ class InfoWindow { /// This does not have to be globally unique, only unique among the list. @immutable class MarkerId { + /// Creates an immutable identifier for a [Marker]. MarkerId(this.value) : assert(value != null); /// value of the [MarkerId]. @@ -146,6 +148,8 @@ class Marker { /// * has an axis-aligned icon; [rotation] is 0.0 /// * is visible; [visible] is true /// * is placed at the base of the drawing order; [zIndex] is 0.0 + /// * reports [onTap] events + /// * reports [onDragEnd] events const Marker({ @required this.markerId, this.alpha = 1.0, @@ -217,6 +221,7 @@ class Marker { /// Callbacks to receive tap events for markers placed on this map. final VoidCallback onTap; + /// Signature reporting the new [LatLng] at the end of a drag event. final ValueChanged onDragEnd; /// Creates a new [Marker] object whose values are the same as this instance, diff --git a/packages/google_maps_flutter/lib/src/pattern_item.dart b/packages/google_maps_flutter/lib/src/pattern_item.dart index 6d30c72d7b11..82e8703d10e2 100644 --- a/packages/google_maps_flutter/lib/src/pattern_item.dart +++ b/packages/google_maps_flutter/lib/src/pattern_item.dart @@ -9,6 +9,7 @@ part of google_maps_flutter; class PatternItem { const PatternItem._(this._json); + /// A dot used in the stroke pattern for a [Polyline]. static const PatternItem dot = PatternItem._(['dot']); /// A dash used in the stroke pattern for a [Polyline]. diff --git a/packages/google_maps_flutter/lib/src/polygon.dart b/packages/google_maps_flutter/lib/src/polygon.dart index 4aed3bd74bdd..e6b26ca9c7d3 100644 --- a/packages/google_maps_flutter/lib/src/polygon.dart +++ b/packages/google_maps_flutter/lib/src/polygon.dart @@ -9,6 +9,7 @@ part of google_maps_flutter; /// This does not have to be globally unique, only unique among the list. @immutable class PolygonId { + /// Creates an immutable identifier for a [Polygon]. PolygonId(this.value) : assert(value != null); /// value of the [PolygonId]. @@ -34,6 +35,7 @@ class PolygonId { /// Draws a polygon through geographical locations on the map. @immutable class Polygon { + /// Creates an immutable representation of a polygon through geographical locations on the map. const Polygon({ @required this.polygonId, this.consumeTapEvents = false, diff --git a/packages/google_maps_flutter/lib/src/polyline.dart b/packages/google_maps_flutter/lib/src/polyline.dart index 1eac1458fa7b..0d7684fb404d 100644 --- a/packages/google_maps_flutter/lib/src/polyline.dart +++ b/packages/google_maps_flutter/lib/src/polyline.dart @@ -9,6 +9,9 @@ part of google_maps_flutter; /// This does not have to be globally unique, only unique among the list. @immutable class PolylineId { + /// Creates an immutable object representing a [PolylineId] among [GoogleMap] polylines. + /// + /// An [AssertionError] will be thrown if [value] is null. PolylineId(this.value) : assert(value != null); /// value of the [PolylineId]. @@ -34,6 +37,7 @@ class PolylineId { /// Draws a line through geographical locations on the map. @immutable class Polyline { + /// Creates an immutable object representing a line drawn through geographical locations on the map. const Polyline({ @required this.polylineId, this.consumeTapEvents = false, diff --git a/packages/google_maps_flutter/lib/src/screen_coordinate.dart b/packages/google_maps_flutter/lib/src/screen_coordinate.dart index 83e57514c2a0..e58abe9cefad 100644 --- a/packages/google_maps_flutter/lib/src/screen_coordinate.dart +++ b/packages/google_maps_flutter/lib/src/screen_coordinate.dart @@ -11,12 +11,16 @@ part of google_maps_flutter; /// corresponds to top-left of the [GoogleMap] not the whole screen. @immutable class ScreenCoordinate { + /// Creates an immutable representation of a point coordinate in the [GoogleMap]'s view. const ScreenCoordinate({ @required this.x, @required this.y, }); + /// Represents the number of pixels from the left of the [GoogleMap]. final int x; + + /// Represents the number of pixels from the top of the [GoogleMap]. final int y; dynamic _toJson() { diff --git a/packages/google_maps_flutter/lib/src/ui.dart b/packages/google_maps_flutter/lib/src/ui.dart index 1fb18a051375..4b57ebd7440f 100644 --- a/packages/google_maps_flutter/lib/src/ui.dart +++ b/packages/google_maps_flutter/lib/src/ui.dart @@ -66,6 +66,9 @@ class CameraTargetBounds { // distinguishing between specifying unbounded zooming (null `minZoom` and // `maxZoom`) from not specifying anything (null `MinMaxZoomPreference`). class MinMaxZoomPreference { + /// Creates a immutable representation of the preferred minimum and maximum zoom values for the map camera. + /// + /// [AssertionError] will be thrown if [minZoom] > [maxZoom]. const MinMaxZoomPreference(this.minZoom, this.maxZoom) : assert(minZoom == null || maxZoom == null || minZoom <= maxZoom); @@ -103,7 +106,9 @@ class MinMaxZoomPreference { /// See also: `setStyle` on [GoogleMapController] for why this exception /// might be thrown. class MapStyleException implements Exception { + /// Default constructor for [MapStyleException]. const MapStyleException(this.cause); + /// The reason `GoogleMapController.setStyle` would throw this exception. final String cause; } From 838f79b31db85edead1bf946c221a76b3091d882 Mon Sep 17 00:00:00 2001 From: Maurice Parrish Date: Tue, 26 Nov 2019 14:40:39 -0800 Subject: [PATCH 5/5] Ignore example lint and await driver close --- packages/google_maps_flutter/example/lib/marker_icons.dart | 1 + .../example/test_driver/google_maps_e2e_test.dart | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google_maps_flutter/example/lib/marker_icons.dart b/packages/google_maps_flutter/example/lib/marker_icons.dart index d22e2fbbc38b..ad1ec389a14d 100644 --- a/packages/google_maps_flutter/example/lib/marker_icons.dart +++ b/packages/google_maps_flutter/example/lib/marker_icons.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. // ignore_for_file: public_member_api_docs +// ignore_for_file: unawaited_futures import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; diff --git a/packages/google_maps_flutter/example/test_driver/google_maps_e2e_test.dart b/packages/google_maps_flutter/example/test_driver/google_maps_e2e_test.dart index ff6e9ce74ad9..f3aa9e218d82 100644 --- a/packages/google_maps_flutter/example/test_driver/google_maps_e2e_test.dart +++ b/packages/google_maps_flutter/example/test_driver/google_maps_e2e_test.dart @@ -10,6 +10,6 @@ Future main() async { final FlutterDriver driver = await FlutterDriver.connect(); final String result = await driver.requestData(null, timeout: const Duration(minutes: 1)); - driver.close(); + await driver.close(); exit(result == 'pass' ? 0 : 1); }