Skip to content

Commit

Permalink
Update dartdoc comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
xclud committed Jul 16, 2022
1 parent 8918f79 commit e0af991
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/src/layers/polyline_layer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ void _forEachPair<T>(List<T> list, Function(T a, T b) callback) {
/// Find the coefficients (a,b) of a line of equation y = a.x + b,
/// or the constant x for vertical lines
/// Return null if there's no equation possible
class _LineEquation {
const _LineEquation({this.x, this.a, this.b});

Expand Down
1 change: 1 addition & 0 deletions lib/src/map_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class MapLayout extends InheritedWidget {
MapTransformer transformer,
) builder;

/// Whether the framework should notify widgets that inherit from this widget.
@override
bool updateShouldNotify(covariant MapLayout oldWidget) {
return oldWidget.tileSize != tileSize ||
Expand Down
4 changes: 4 additions & 0 deletions lib/src/polyline.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:ui';

import 'package:latlng/latlng.dart';

/// Defines a polyline to draw on the map.
class Polyline {
const Polyline({
required this.data,
Expand All @@ -19,6 +20,9 @@ class Polyline {
/// Offset of the polyline in pixels when rendered on screen.
final double? offset;

/// Used to draw the polyline in custom mode. E.g. drawing a color gradient.
///
/// If this function callback is provided, the default rendering will be disabled.
final Function(
Canvas canvas,
Polyline polyline,
Expand Down
4 changes: 4 additions & 0 deletions lib/src/transformer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class MapTransformer {
/// Map controller which is used in [MapLayoutBuilder].
final MapController controller;

/// The size of the tiles. This is usually equal to the size of the .png file taken from the server. E.g. 256 for a 256x256 pixels or 512 for a 512x512 pixels.
final int tileSize;

/// Constraints of the current widget.
Expand Down Expand Up @@ -57,10 +58,12 @@ class MapTransformer {
return Offset(_centerX + dx * s, _centerY + dy * s);
}

/// Converts many XY coordinates to [LatLng].
Iterable<LatLng> toLatLngMany(Iterable<Offset> positions) {
return positions.map((e) => toLatLng(e));
}

/// Converts many [LatLng] coordinates to XY [Offset].
Iterable<Offset> toOffsetMany(Iterable<LatLng> locations) {
return locations.map((e) => toOffset(e));
}
Expand Down Expand Up @@ -102,6 +105,7 @@ class MapTransformer {
}
}

/// For internal use.
MapTransformer createMapTransformer({
required MapController controller,
required BoxConstraints constraints,
Expand Down

0 comments on commit e0af991

Please sign in to comment.