From 8e276d11edfc10171ebf5e0e08ce20c3c520c979 Mon Sep 17 00:00:00 2001 From: JaffaKetchup Date: Fri, 12 Jan 2024 09:42:40 +0000 Subject: [PATCH] Renamed `LayerHit` to `LayerHitResult` for improved clarity --- lib/src/layer/general/hit_detection.dart | 8 ++++---- lib/src/layer/polyline_layer/painter.dart | 2 +- lib/src/layer/polyline_layer/polyline_layer.dart | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/src/layer/general/hit_detection.dart b/lib/src/layer/general/hit_detection.dart index 5c7536085..2e28c211e 100644 --- a/lib/src/layer/general/hit_detection.dart +++ b/lib/src/layer/general/hit_detection.dart @@ -7,7 +7,7 @@ import 'package:meta/meta.dart'; /// /// Not emitted if the hit was not over a feature. @immutable -class LayerHit { +class LayerHitResult { /// `hitValue`s from all features hit (which have `hitValue`s defined) /// /// If a feature is hit but has no `hitValue` defined, it will not be included. @@ -22,11 +22,11 @@ class LayerHit { final LatLng point; @internal - const LayerHit({required this.hitValues, required this.point}); + const LayerHitResult({required this.hitValues, required this.point}); } /// A [ValueNotifier] that notifies: /// -/// * a [LayerHit] when a hit is detected on a feature in a layer +/// * a [LayerHitResult] when a hit is detected on a feature in a layer /// * `null` when a hit is detected on the layer but not on a feature -typedef LayerHitNotifier = ValueNotifier?>; +typedef LayerHitNotifier = ValueNotifier?>; diff --git a/lib/src/layer/polyline_layer/painter.dart b/lib/src/layer/polyline_layer/painter.dart index 4f80092e0..6637c4a84 100644 --- a/lib/src/layer/polyline_layer/painter.dart +++ b/lib/src/layer/polyline_layer/painter.dart @@ -88,7 +88,7 @@ class PolylinePainter extends CustomPainter { return false; } - hitNotifier!.value = LayerHit( + hitNotifier!.value = LayerHitResult( hitValues: _hits, point: camera.pointToLatLng(math.Point(position.dx, position.dy)), ); diff --git a/lib/src/layer/polyline_layer/polyline_layer.dart b/lib/src/layer/polyline_layer/polyline_layer.dart index b0774c534..25d14010e 100644 --- a/lib/src/layer/polyline_layer/polyline_layer.dart +++ b/lib/src/layer/polyline_layer/polyline_layer.dart @@ -40,8 +40,8 @@ class PolylineLayer extends StatefulWidget { /// /// If a notifier is not provided, hit testing is not performed. /// - /// Notified with a [LayerHit] if any polylines are hit, otherwise notified - /// with `null`. + /// Notified with a [LayerHitResult] if any polylines are hit, otherwise + /// notified with `null`. /// /// See online documentation for more detailed usage instructions. See the /// example project for an example implementation.