Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Commit

Permalink
doc: Strong-Mode support
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMitterer committed Nov 16, 2016
1 parent d39df94 commit 86b858c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
16 changes: 16 additions & 0 deletions .analysis_options
@@ -0,0 +1,16 @@
# ------------------------------------------------------------------------------
# Config for Analyzer
# More: https://pub.dartlang.org/packages/analyzer
#
# Analyzer options:
# https://www.dartlang.org/guides/language/analysis-options
#

analyzer:
strong-mode: true

# Exclude wegen https://github.com/dart-lang/sdk/issues/26420
# und https://github.com/dart-lang/test/issues/436

# exclude:
# - test/**
2 changes: 1 addition & 1 deletion lib/latlong/LatLng.dart
Expand Up @@ -67,7 +67,7 @@ class LatLng {

int get hashCode => latitude.hashCode + longitude.hashCode;

bool operator==(final LatLng other)
bool operator==(final Object other)
=> other is LatLng && latitude == other.latitude && longitude == other.longitude;

LatLng round({ final int decimals: 6 })
Expand Down
8 changes: 4 additions & 4 deletions lib/latlong/Path.dart
Expand Up @@ -152,7 +152,7 @@ class Path<T extends LatLng> {
// Add step on the given path
// Intermediate step is necessary to stay type-safe
final LatLng tempStep = _distance.offset(baseStep,firstStepPos,bearing);
final T nextStep = _latLngFactory(tempStep.latitude,tempStep.longitude);
final LatLng nextStep = _latLngFactory(tempStep.latitude,tempStep.longitude);
path.add(nextStep);
firstStepPos += stepDistance;

Expand Down Expand Up @@ -238,7 +238,7 @@ class Path<T extends LatLng> {
/// Calculates the center of a collection of geo coordinates
///
/// The function rounds the result to 6 decimals
T get center {
LatLng get center {
Validate.notEmpty(coordinates,"Coordinates must not be empty!");

double X = 0.0;
Expand Down Expand Up @@ -287,7 +287,7 @@ class Path<T extends LatLng> {
//- private -----------------------------------------------------------------------------------

/// 4 Points are necessary to create a [CatmullRomSpline2D]
CatmullRomSpline2D<double> _createSpline(final T p0,final T p1,final T p2,final T p3) {
CatmullRomSpline2D<double> _createSpline(final LatLng p0,final LatLng p1,final LatLng p2,final LatLng p3) {
Validate.notNull(p0);
Validate.notNull(p1);
Validate.notNull(p2);
Expand All @@ -302,6 +302,6 @@ class Path<T extends LatLng> {
}

/// Convert [Point2D] to [LatLng]
T _pointToLatLng(final Point2D point) => _latLngFactory(point.x,point.y);
LatLng _pointToLatLng(final Point2D point) => _latLngFactory(point.x,point.y);
}

2 changes: 1 addition & 1 deletion lib/latlong/interfaces.dart
Expand Up @@ -20,6 +20,6 @@
part of latlong;

abstract class DistanceCalculator {
double distance(final LatLng p1, final LatLng p2);
num distance(final LatLng p1, final LatLng p2);
LatLng offset(final LatLng from,final double distanceInMeter,final double bearing);
}
2 changes: 1 addition & 1 deletion tool/grind.dart
@@ -1,6 +1,6 @@
import 'package:grinder/grinder.dart';

main(args) => grind(args);
main(final List<String> args) => grind(args);

@DefaultTask()
@Depends(test)
Expand Down

0 comments on commit 86b858c

Please sign in to comment.