Skip to content

Commit

Permalink
Fixes few lint warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
xclud committed Jun 24, 2021
1 parent f175faa commit 8c68ae8
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 11 deletions.
4 changes: 4 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
4 changes: 4 additions & 0 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
1 change: 1 addition & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^1.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
Expand Down
6 changes: 5 additions & 1 deletion lib/src/layout_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import 'package:map/map.dart';
///
/// Similar to the [LayoutBuilder] widget.
class MapLayoutBuilder extends StatelessWidget {
MapLayoutBuilder({required this.controller, required this.builder});
const MapLayoutBuilder({
Key? key,
required this.controller,
required this.builder,
}) : super(key: key);

final MapController controller;
final MapLayoutWidgetBuilder builder;
Expand Down
8 changes: 4 additions & 4 deletions lib/src/map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Map extends StatefulWidget {
final MapController controller;
final MapTileBuilder builder;

Map({
const Map({
Key? key,
required this.builder,
required this.controller,
Expand Down Expand Up @@ -109,9 +109,9 @@ class _MapState extends State<Map> {
class MapController extends ChangeNotifier {
MapController({
required LatLng location,
double zoom: 14,
this.projection: const EPSG4326(),
this.tileSize: 256,
double zoom = 14,
this.projection = const EPSG4326(),
this.tileSize = 256,
}) : _center = location,
_zoom = zoom;

Expand Down
12 changes: 6 additions & 6 deletions lib/src/vt/vector_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ List<List<int>> _decodePoint(List<int> geometries) {
List<List<int>> coords = [];
List<int> point = [];

geometries.forEach((commandInt) {
for (var commandInt in geometries) {
if (length <= 0) {
_Command command = _Command.fromInt(commandInt);

Expand All @@ -181,7 +181,7 @@ List<List<int>> _decodePoint(List<int> geometries) {
coords.add(point);
point = [];
}
});
}

return coords;
}
Expand All @@ -198,7 +198,7 @@ List<List<List<int>>> _decodeLineString(List<int> geometries) {
List<List<List<int>>> coords = [];
List<List<int>> ring = [];

geometries.forEach((commandInt) {
for (var commandInt in geometries) {
if (length <= 0) {
_Command command = _Command.fromInt(commandInt);

Expand All @@ -220,7 +220,7 @@ List<List<List<int>>> _decodeLineString(List<int> geometries) {
coords.add(ring);
ring = [];
}
});
}

return coords;
}
Expand All @@ -238,7 +238,7 @@ List<List<List<List<int>>>> _decodePolygon(List<int> geometries) {
List<List<List<int>>> coords = [];
List<List<int>> ring = [];

geometries.forEach((commandInt) {
for (var commandInt in geometries) {
if (length <= 0 || commandId == _closePath) {
_Command command = _Command.fromInt(commandInt);

Expand Down Expand Up @@ -267,7 +267,7 @@ List<List<List<List<int>>>> _decodePolygon(List<int> geometries) {
coords = [];
}
}
});
}

polygons.add(coords);
return polygons;
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^1.0.0

0 comments on commit 8c68ae8

Please sign in to comment.