diff --git a/lib/src/types/circles.dart b/lib/src/types/circles.dart index c0165599..5ce0554d 100644 --- a/lib/src/types/circles.dart +++ b/lib/src/types/circles.dart @@ -52,6 +52,9 @@ class Circle { @override int get hashCode => Object.hash(circleId.hashCode, options.hashCode); + + @override + String toString() => 'Circle(circleId: $circleId, options: $options)'; } /// Defines CircleOptions for a circle. @@ -157,6 +160,21 @@ class CircleOptions { visible.hashCode, zIndex.hashCode, ); + + @override + String toString() => + 'CircleOptions(' + 'position: ' + '$position, ' + 'radius: $radius, ' + 'strokeWidth: $strokeWidth, ' + 'strokeColor: $strokeColor, ' + 'strokePattern: $strokePattern, ' + 'fillColor: $fillColor, ' + 'zIndex: $zIndex, ' + 'visible: $visible, ' + 'clickable: $clickable' + ')'; } /// Event emitted when a circle is clicked. @@ -169,4 +187,7 @@ class CircleClickedEvent { /// Id of the circle that has been tapped. final String circleId; + + @override + String toString() => 'CircleClickedEvent(circleId: $circleId)'; } diff --git a/lib/src/types/images.dart b/lib/src/types/images.dart index 186d135d..2de34b8c 100644 --- a/lib/src/types/images.dart +++ b/lib/src/types/images.dart @@ -65,4 +65,13 @@ class ImageDescriptor { width.hashCode, height.hashCode, ); + + @override + String toString() => + 'ImageDescriptor(' + 'registeredImageId: $registeredImageId, ' + 'imagePixelRatio: $imagePixelRatio, ' + 'width: $width, ' + 'height: $height' + ')'; } diff --git a/lib/src/types/lat_lng.dart b/lib/src/types/lat_lng.dart index c6dbac65..a5e8cd8f 100644 --- a/lib/src/types/lat_lng.dart +++ b/lib/src/types/lat_lng.dart @@ -71,4 +71,7 @@ class LatLng { @override int get hashCode => Object.hash(latitude.hashCode, longitude.hashCode); + + @override + String toString() => 'LatLng(latitude: $latitude, longitude: $longitude)'; } diff --git a/lib/src/types/lat_lng_bounds.dart b/lib/src/types/lat_lng_bounds.dart index 7b3c7ed8..25e1d243 100644 --- a/lib/src/types/lat_lng_bounds.dart +++ b/lib/src/types/lat_lng_bounds.dart @@ -120,4 +120,8 @@ class LatLngBounds { @override int get hashCode => Object.hash(southwest.hashCode, northeast.hashCode); + + @override + String toString() => + 'LatLngBounds(southwest: $southwest, northeast: $northeast)'; } diff --git a/lib/src/types/markers.dart b/lib/src/types/markers.dart index 78b8582b..f2284ae0 100644 --- a/lib/src/types/markers.dart +++ b/lib/src/types/markers.dart @@ -50,6 +50,9 @@ class Marker { @override int get hashCode => Object.hash(markerId.hashCode, options.hashCode); + + @override + String toString() => 'Marker(markerId: $markerId, options: $options)'; } /// Defines MarkerOptions for a marker. @@ -198,6 +201,22 @@ class MarkerOptions { visible.hashCode, zIndex.hashCode, ); + + @override + String toString() => + 'MarkerOptions(' + 'alpha: $alpha, ' + 'anchor: $anchor, ' + 'draggable: $draggable, ' + 'flat: $flat, ' + 'icon: $icon, ' + 'consumeTapEvents: $consumeTapEvents, ' + 'position: $position, ' + 'rotation: $rotation, ' + 'infoWindow: $infoWindow, ' + 'visible: $visible, ' + 'zIndex: $zIndex' + ')'; } /// Text labels for [Marker] info window. @@ -247,6 +266,10 @@ class InfoWindow { @override int get hashCode => Object.hash(title.hashCode, snippet.hashCode, anchor.hashCode); + + @override + String toString() => + 'InfoWindow(title: $title, snippet: $snippet, anchor: $anchor)'; } /// Specifies the anchor to be at a particular point in the marker image. @@ -276,6 +299,9 @@ class MarkerAnchor { @override int get hashCode => Object.hash(u.hashCode, v.hashCode); + + @override + String toString() => 'MarkerAnchor(u: $u, v: $v)'; } /// Marker event types @@ -322,6 +348,10 @@ class MarkerEvent { /// Type of the event. final MarkerEventType eventType; + + @override + String toString() => + 'MarkerEvent(markerId: $markerId, eventType: $eventType)'; } /// Marker drag event sent from platform side. @@ -344,4 +374,12 @@ class MarkerDragEvent { /// Type of the event. final MarkerDragEventType eventType; + + @override + String toString() => + 'MarkerDragEvent(' + 'markerId: $markerId, ' + 'eventType: $eventType, ' + 'position: $position' + ')'; } diff --git a/lib/src/types/navigation_destinations.dart b/lib/src/types/navigation_destinations.dart index 4b2f4ff9..22de85c1 100644 --- a/lib/src/types/navigation_destinations.dart +++ b/lib/src/types/navigation_destinations.dart @@ -42,6 +42,15 @@ class Destinations { /// Navigation route token options. final RouteTokenOptions? routeTokenOptions; + + @override + String toString() => + 'Destinations(' + 'waypoints: $waypoints, ' + 'displayOptions: $displayOptions, ' + 'routingOptions: $routingOptions, ' + 'routeTokenOptions: $routeTokenOptions' + ')'; } /// Provides options for routing using a route token @@ -70,6 +79,10 @@ class RouteTokenOptions { /// If there is a mismatch, [travelMode] will override the travel mode used to /// generate the [routeToken]. final NavigationTravelMode? travelMode; + + @override + String toString() => + 'RouteTokenOptions(routeToken: $routeToken, travelMode: $travelMode)'; } /// Alternative routes strategy. @@ -155,6 +168,19 @@ class RoutingOptions { /// Maximum time to wait for a location fix before failure. (Only Android) final int? locationTimeoutMs; + + @override + String toString() => + 'RoutingOptions(' + 'alternateRoutesStrategy: $alternateRoutesStrategy, ' + 'routingStrategy: $routingStrategy, ' + 'targetDistanceMeters: $targetDistanceMeters, ' + 'travelMode: $travelMode, ' + 'avoidTolls: $avoidTolls, ' + 'avoidFerries: $avoidFerries, ' + 'avoidHighways: $avoidHighways, ' + 'locationTimeoutMs: $locationTimeoutMs' + ')'; } /// Display options. @@ -178,6 +204,14 @@ class NavigationDisplayOptions { /// Show traffic lights. final bool? showTrafficLights; + + @override + String toString() => + 'NavigationDisplayOptions(' + 'showDestinationMarkers: $showDestinationMarkers, ' + 'showStopSigns: $showStopSigns, ' + 'showTrafficLights: $showTrafficLights' + ')'; } /// Navigation waypoint with different constructors based in on type of @@ -248,6 +282,16 @@ class NavigationWaypoint { /// has a lane direction that aligns (within +/- 55 degrees) with the side of /// the road that the waypoint is on. int? preferredSegmentHeading; + + @override + String toString() => + 'NavigationWaypoint(' + 'title: $title, ' + 'target: $target, ' + 'placeID: $placeID, ' + 'preferSameSideOfRoad: $preferSameSideOfRoad, ' + 'preferredSegmentHeading: $preferredSegmentHeading' + ')'; } /// Status of the navigation routing. @@ -310,6 +354,10 @@ class NavigationTimeAndDistance { /// Distance to destination. final double distance; + + @override + String toString() => + 'NavigationTimeAndDistance(time: $time, distance: $distance)'; } /// Navigation audio guidance type. @@ -343,4 +391,12 @@ class NavigationAudioGuidanceSettings { /// Guidance type. final NavigationAudioGuidanceType? guidanceType; + + @override + String toString() => + 'NavigationAudioGuidanceSettings(' + 'isBluetoothAudioEnabled: $isBluetoothAudioEnabled, ' + 'isVibrationEnabled: $isVibrationEnabled, ' + 'guidanceType: $guidanceType' + ')'; } diff --git a/lib/src/types/navigation_view_types.dart b/lib/src/types/navigation_view_types.dart index f790ea61..2632a575 100644 --- a/lib/src/types/navigation_view_types.dart +++ b/lib/src/types/navigation_view_types.dart @@ -75,6 +75,15 @@ class CameraPosition { /// Zoom level near the center of the screen. final double zoom; + + @override + String toString() => + 'CameraPosition(' + 'bearing: $bearing, ' + 'target: $target, ' + 'tilt: $tilt, ' + 'zoom: $zoom' + ')'; } /// Parameter given to parameter given to the [GoogleNavigationViewController.followMyLocation] @@ -97,12 +106,19 @@ class CustomNavigationAutoEvent { final Object? data; CustomNavigationAutoEvent({required this.event, required this.data}); + + @override + String toString() => 'CustomNavigationAutoEvent(event: $event, data: $data)'; } class AutoScreenAvailabilityChangedEvent { final bool isAvailable; AutoScreenAvailabilityChangedEvent({required this.isAvailable}); + + @override + String toString() => + 'AutoScreenAvailabilityChangedEvent(isAvailable: $isAvailable)'; } /// Represents the click position in a Google Maps view. @@ -114,6 +130,9 @@ class MapClickEvent { /// The location where the click happened. final LatLng target; + + @override + String toString() => 'MapClickEvent(target: $target)'; } /// Represents navigation UI changed event in a view. @@ -124,6 +143,12 @@ class NavigationUIEnabledChangedEvent { /// Value representing whether UI changed or not. final bool navigationUIEnabled; + + @override + String toString() => + 'NavigationUIEnabledChangedEvent(' + 'navigationUIEnabled: $navigationUIEnabled' + ')'; } /// Represents the long click position in a Google Maps view. @@ -135,6 +160,9 @@ class MapLongClickEvent { /// The location where the long click happened. final LatLng target; + + @override + String toString() => 'MapLongClickEvent(target: $target)'; } /// Traffic data statuses @@ -165,6 +193,14 @@ class RouteSegmentTrafficDataRoadStretchRenderingData { /// Offset in meters. final int offsetMeters; + + @override + String toString() => + 'RouteSegmentTrafficDataRoadStretchRenderingData(' + 'style: $style, ' + 'lengthMeters: $lengthMeters, ' + 'offsetMeters: $offsetMeters' + ')'; } /// Route segment traffic data road strech rendering style. @@ -195,6 +231,13 @@ class RouteSegmentTrafficData { /// Rendering data list. final List roadStretchRenderingDataList; + + @override + String toString() => + 'RouteSegmentTrafficData(' + 'status: $status, ' + 'roadStretchRenderingDataList: $roadStretchRenderingDataList' + ')'; } /// Navigation route segment @@ -220,6 +263,15 @@ class RouteSegment { /// Destination waypoint. final NavigationWaypoint? destinationWaypoint; + + @override + String toString() => + 'RouteSegment(' + 'trafficData: $trafficData, ' + 'destinationLatLng: $destinationLatLng, ' + 'latLngs: $latLngs, ' + 'destinationWaypoint: $destinationWaypoint' + ')'; } /// Internal camera update type. @@ -396,6 +448,21 @@ class CameraUpdate { /// The screen position co-ordinates for the zoom-by camera. Offset? focus; + + @override + String toString() => + 'CameraUpdate(' + 'type: $type, ' + 'cameraPosition: $cameraPosition, ' + 'latLng: $latLng, ' + 'bounds: $bounds, ' + 'padding: $padding, ' + 'zoom: $zoom, ' + 'zoomByAmount: $zoomByAmount, ' + 'scrollByDx: $scrollByDx, ' + 'scrollByDy: $scrollByDy, ' + 'focus: $focus' + ')'; } /// My location clicked event. @@ -444,4 +511,8 @@ class CameraChangedEvent { /// Current position of the camera. final CameraPosition position; + + @override + String toString() => + 'CameraChangedEvent(eventType: $eventType, position: $position)'; } diff --git a/lib/src/types/navinfo.dart b/lib/src/types/navinfo.dart index 3a9a0e76..cfc826ec 100644 --- a/lib/src/types/navinfo.dart +++ b/lib/src/types/navinfo.dart @@ -353,6 +353,22 @@ class StepInfo { /// The index of the step in the list of all steps in the route. final int stepNumber; + + @override + String toString() => + 'StepInfo(' + 'stepNumber: $stepNumber, ' + 'distanceFromPrevStepMeters: $distanceFromPrevStepMeters, ' + 'timeFromPrevStepSeconds: $timeFromPrevStepSeconds, ' + 'drivingSide: $drivingSide, ' + 'exitNumber: $exitNumber, ' + 'fullInstructions: $fullInstructions, ' + 'fullRoadName: $fullRoadName, ' + 'simpleRoadName: $simpleRoadName, ' + 'roundaboutTurnNumber: $roundaboutTurnNumber, ' + 'lanes: $lanes, ' + 'maneuver: $maneuver' + ')'; } /// Contains information about the state of navigation, the current nav step if @@ -410,6 +426,21 @@ class NavInfo { /// /// Android only. final int? timeToNextDestinationSeconds; + + @override + String toString() => + 'NavInfo(' + 'navState: $navState, ' + 'currentStep: $currentStep, ' + 'remainingSteps: $remainingSteps, ' + 'routeChanged: $routeChanged, ' + 'distanceToCurrentStepMeters: $distanceToCurrentStepMeters, ' + 'distanceToFinalDestinationMeters: $distanceToFinalDestinationMeters, ' + 'distanceToNextDestinationMeters: $distanceToNextDestinationMeters, ' + 'timeToCurrentStepSeconds: $timeToCurrentStepSeconds, ' + 'timeToFinalDestinationSeconds: $timeToFinalDestinationSeconds, ' + 'timeToNextDestinationSeconds: $timeToNextDestinationSeconds' + ')'; } /// NavInfo event message @@ -420,4 +451,7 @@ class NavInfoEvent { /// Navigation information. final NavInfo navInfo; + + @override + String toString() => 'NavInfoEvent(navInfo: $navInfo)'; } diff --git a/lib/src/types/polygons.dart b/lib/src/types/polygons.dart index 796d83a5..0832d15b 100644 --- a/lib/src/types/polygons.dart +++ b/lib/src/types/polygons.dart @@ -53,6 +53,9 @@ class Polygon { @override int get hashCode => Object.hash(polygonId.hashCode, options.hashCode); + + @override + String toString() => 'Polygon(polygonId: $polygonId, options: $options)'; } /// Defines PolygonOptions for a polygon. @@ -175,6 +178,20 @@ class PolygonOptions { visible.hashCode, zIndex.hashCode, ); + + @override + String toString() => + 'PolygonOptions(' + 'points: $points, ' + 'holes: $holes, ' + 'clickable: $clickable, ' + 'fillColor: $fillColor, ' + 'geodesic: $geodesic, ' + 'strokeColor: $strokeColor, ' + 'strokeWidth: $strokeWidth, ' + 'visible: $visible, ' + 'zIndex: $zIndex' + ')'; } /// Event emitted when a polygon is clicked. @@ -187,4 +204,7 @@ class PolygonClickedEvent { /// Id of the polygon that has been tapped. final String polygonId; + + @override + String toString() => 'PolygonClickedEvent(polygonId: $polygonId)'; } diff --git a/lib/src/types/polylines.dart b/lib/src/types/polylines.dart index 74985f99..9f4e0be9 100644 --- a/lib/src/types/polylines.dart +++ b/lib/src/types/polylines.dart @@ -52,6 +52,9 @@ class Polyline { @override int get hashCode => Object.hash(polylineId.hashCode, options.hashCode); + + @override + String toString() => 'Polyline(polylineId: $polylineId, options: $options)'; } /// Defines PolylineOptions for a polyline. @@ -164,6 +167,21 @@ class PolylineOptions { zIndex.hashCode, spans.hashCode, ); + + @override + String toString() => + 'PolylineOptions(' + 'points: $points, ' + 'clickable: $clickable, ' + 'geodesic: $geodesic, ' + 'strokeColor: $strokeColor, ' + 'strokeJointType: $strokeJointType, ' + 'strokePattern: $strokePattern, ' + 'strokeWidth: $strokeWidth, ' + 'visible: $visible, ' + 'zIndex: $zIndex, ' + 'spans: $spans' + ')'; } /// Style for stroke of a polyline. @@ -187,6 +205,14 @@ class StyleSpanStrokeStyle { /// Gradient to color. int? toColor; + + @override + String toString() => + 'StyleSpanStrokeStyle(' + 'solidColor: $solidColor, ' + 'fromColor: $fromColor, ' + 'toColor: $toColor' + ')'; } /// Style and length of a stroke on polyline. @@ -201,6 +227,9 @@ class StyleSpan { /// Style of a stroke. final StyleSpanStrokeStyle style; + + @override + String toString() => 'StyleSpan(length: $length, style: $style)'; } /// Joint types for [Polyline] and outline of [Polygon]. @@ -227,4 +256,7 @@ class PolylineClickedEvent { /// Id of the polyline that has been tapped. final String polylineId; + + @override + String toString() => 'PolylineClickedEvent(polylineId: $polylineId)'; } diff --git a/lib/src/types/simulation.dart b/lib/src/types/simulation.dart index 5c86db98..7f98b57b 100644 --- a/lib/src/types/simulation.dart +++ b/lib/src/types/simulation.dart @@ -44,6 +44,13 @@ class SpeedingUpdatedEvent { /// Severity of the speeding. final SpeedAlertSeverity severity; + + @override + String toString() => + 'SpeedingUpdatedEvent(' + 'percentageAboveLimit: $percentageAboveLimit, ' + 'severity: $severity' + ')'; } /// RoadSnappedLocationUpdated event message. @@ -54,6 +61,9 @@ class RoadSnappedLocationUpdatedEvent { /// Coordinate of the updated location. final LatLng location; + + @override + String toString() => 'RoadSnappedLocationUpdatedEvent(location: $location)'; } /// RoadSnappedRawLocationUpdated event message (Android only). @@ -64,6 +74,10 @@ class RoadSnappedRawLocationUpdatedEvent { /// Coordinate of the updated location. final LatLng location; + + @override + String toString() => + 'RoadSnappedRawLocationUpdatedEvent(location: $location)'; } /// GpsAvailabilityUpdated event message (Android only). @@ -74,6 +88,9 @@ class GpsAvailabilityUpdatedEvent { /// GPS availability. final bool available; + + @override + String toString() => 'GpsAvailabilityUpdatedEvent(available: $available)'; } /// Navigation simulation options. @@ -84,6 +101,9 @@ class SimulationOptions { /// Speed multiplier. final double speedMultiplier; + + @override + String toString() => 'SimulationOptions(speedMultiplier: $speedMultiplier)'; } /// Remaining time or distance change event message. @@ -100,6 +120,13 @@ class RemainingTimeOrDistanceChangedEvent { /// Remaining time in seconds. final double remainingTime; + + @override + String toString() => + 'RemainingTimeOrDistanceChangedEvent(' + 'remainingDistance: $remainingDistance, ' + 'remainingTime: $remainingTime' + ')'; } /// On arrival event message @@ -110,4 +137,7 @@ class OnArrivalEvent { /// Arrival waypoint. final NavigationWaypoint waypoint; + + @override + String toString() => 'OnArrivalEvent(waypoint: $waypoint)'; } diff --git a/lib/src/types/stroke_patterns.dart b/lib/src/types/stroke_patterns.dart index 00d2c96c..23982ab2 100644 --- a/lib/src/types/stroke_patterns.dart +++ b/lib/src/types/stroke_patterns.dart @@ -66,6 +66,9 @@ class DashPattern extends PatternItem { @override int get hashCode => length.hashCode; + + @override + String toString() => 'DashPattern(length: $length)'; } /// Class representing a dot used in the stroke pattern for a [Polyline] or the outline of a [Polygon] or [Circle]. @@ -75,6 +78,23 @@ class DashPattern extends PatternItem { class DotPattern extends PatternItem { /// Initialize [DotPattern] object. const DotPattern() : super(PatternType.dot); + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (other.runtimeType != runtimeType) { + return false; + } + return other is DotPattern; + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + String toString() => 'DotPattern()'; } /// Class representing a gap used in the stroke pattern for a [Polyline] or the outline of a [Polygon] or [Circle]. @@ -101,4 +121,7 @@ class GapPattern extends PatternItem { @override int get hashCode => length.hashCode; + + @override + String toString() => 'GapPattern(length: $length)'; } diff --git a/lib/src/types/view_initialization_options.dart b/lib/src/types/view_initialization_options.dart index 1f27f98b..2b5c07ed 100644 --- a/lib/src/types/view_initialization_options.dart +++ b/lib/src/types/view_initialization_options.dart @@ -63,6 +63,15 @@ class MapViewInitializationOptions { /// designating which gestures should be claimed by the platform view. By default, /// it's an empty set, implying no gestures will be forwarded. final Set> gestureRecognizers; + + @override + String toString() => + 'MapViewInitializationOptions(' + 'layoutDirection: $layoutDirection, ' + 'mapOptions: $mapOptions, ' + 'navigationViewOptions: $navigationViewOptions, ' + 'gestureRecognizers: $gestureRecognizers' + ')'; } /// Encapsulates the initial configuration required to initialize the google map view. @@ -190,6 +199,25 @@ class MapOptions { /// /// Null by default (no padding). final EdgeInsets? padding; + + @override + String toString() => + 'MapOptions(' + 'cameraPosition: $cameraPosition, ' + 'mapType: $mapType, ' + 'compassEnabled: $compassEnabled, ' + 'rotateGesturesEnabled: $rotateGesturesEnabled, ' + 'scrollGesturesEnabled: $scrollGesturesEnabled, ' + 'tiltGesturesEnabled: $tiltGesturesEnabled, ' + 'zoomGesturesEnabled: $zoomGesturesEnabled, ' + 'scrollGesturesEnabledDuringRotateOrZoom: $scrollGesturesEnabledDuringRotateOrZoom, ' + 'mapToolbarEnabled: $mapToolbarEnabled, ' + 'minZoomPreference: $minZoomPreference, ' + 'maxZoomPreference: $maxZoomPreference, ' + 'zoomControlsEnabled: $zoomControlsEnabled, ' + 'cameraTargetBounds: $cameraTargetBounds, ' + 'padding: $padding' + ')'; } /// Determines the initial visibility of the navigation UI on map initialization. @@ -225,4 +253,10 @@ class NavigationViewOptions { /// If set to [NavigationUIEnabledPreference.disabled], navigation view /// initially displays a classic map view. final NavigationUIEnabledPreference navigationUIEnabledPreference; + + @override + String toString() => + 'NavigationViewOptions(' + 'navigationUIEnabledPreference: $navigationUIEnabledPreference' + ')'; }