Skip to content

Commit

Permalink
replace pedantic with lints
Browse files Browse the repository at this point in the history
  • Loading branch information
stafyniaksacha committed Oct 14, 2024
1 parent 7b47253 commit 44b72b6
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 34 deletions.
6 changes: 5 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
include: package:pedantic/analysis_options.yaml
include: package:lints/recommended.yaml

linter:
rules:
constant_identifier_names: false
12 changes: 6 additions & 6 deletions lib/src/navigation/directions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class DirectionsApi {
double walkwayBias = 0,
double alleyBias = 0,
}) async {
var url = endpoint + '/' + version;
var url = '$endpoint/$version';

if (profile != null) {
switch (profile) {
Expand Down Expand Up @@ -75,22 +75,22 @@ class DirectionsApi {
}
}

url += '?access_token=' + api.accessToken!;
url += '?access_token=${api.accessToken!}';

if (profile == NavigationProfile.WALKING) {
if (walkingSpeed != 1.42) {
url += '&walking_speed=' + walkingSpeed.toString();
url += '&walking_speed=$walkingSpeed';
}
if (walkwayBias != 0) {
url += '&walkway_bias=' + walkwayBias.toString();
url += '&walkway_bias=$walkwayBias';
}
if (alleyBias != 0) {
url += '&alley_bias=' + alleyBias.toString();
url += '&alley_bias=$alleyBias';
}
}

if (language != 'en') {
url += '&language=' + language;
url += '&language=$language';
}
if (steps) {
url += '&steps=true';
Expand Down
10 changes: 5 additions & 5 deletions lib/src/navigation/isochrome.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class IsochroneApi {
double denoise = 1.0,
double? generalize,
}) async {
var url = endpoint + '/' + version;
var url = '$endpoint/$version';

if (profile != null) {
switch (profile) {
Expand All @@ -53,7 +53,7 @@ class IsochroneApi {
url += ',';
url += coordinates[LATITUDE].toString();

url += '?access_token=' + api.accessToken!;
url += '?access_token=${api.accessToken!}';

for (var i = 0; i < contoursMinutes.length; i++) {
if (i == 0) {
Expand Down Expand Up @@ -122,10 +122,10 @@ class IsochroneApiResponse {
}

IsochroneApiResponse.fromJson(Map<String, dynamic> json) {
final _message = json['message'] as String?;
final message = json['message'] as String?;

if (_message != null) {
error = NavigationError(message: _message);
if (message != null) {
error = NavigationError(message: message);
}

code = json['code'] as String?;
Expand Down
6 changes: 3 additions & 3 deletions lib/src/navigation/map_matching.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MapMatchingApi {
List<String> waypointNames = const <String>[],
List<List<double>> waypoints = const <List<double>>[],
}) async {
var url = endpoint + '/' + version;
var url = '$endpoint/$version';

if (profile != null) {
switch (profile) {
Expand Down Expand Up @@ -68,10 +68,10 @@ class MapMatchingApi {
}
}

url += '?access_token=' + api.accessToken!;
url += '?access_token=${api.accessToken!}';

if (language != 'en') {
url += '&language=' + language;
url += '&language=$language';
}
if (steps) {
url += '&steps=true';
Expand Down
4 changes: 2 additions & 2 deletions lib/src/navigation/matrix.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MatrixApi {
int fallbackSpeed = 0,
List<int> sources = const <int>[],
}) async {
var url = endpoint + '/' + version;
var url = '$endpoint/$version';

if (profile != null) {
switch (profile) {
Expand Down Expand Up @@ -67,7 +67,7 @@ class MatrixApi {
}
}

url += '?access_token=' + api.accessToken!;
url += '?access_token=${api.accessToken!}';

for (var i = 0; i < annotations.length; i++) {
if (i == 0) {
Expand Down
6 changes: 3 additions & 3 deletions lib/src/navigation/optimization.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class OptimizationApi {
bool steps = false,
bool roundtrip = true,
}) async {
var url = endpoint + '/' + version;
var url = '$endpoint/$version';

if (profile != null) {
switch (profile) {
Expand Down Expand Up @@ -66,10 +66,10 @@ class OptimizationApi {
}
}

url += '?access_token=' + api.accessToken!;
url += '?access_token=${api.accessToken!}';

if (language != 'en') {
url += '&language=' + language;
url += '&language=$language';
}
if (steps) {
url += '&steps=true';
Expand Down
8 changes: 4 additions & 4 deletions lib/src/search/forward_geocoding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ForwardGeocodingApi {
bool routing = false,
List<GeocoderPlaceType> types = const <GeocoderPlaceType>[],
}) async {
var url = this.endpoint + '/' + version;
var url = '${this.endpoint}/$version';

if (endpoint == GeocoderEndpoint.PLACES_PERMANENT) {
url += '/mapbox.places-permanent';
Expand Down Expand Up @@ -78,7 +78,7 @@ class ForwardGeocodingApi {
bool routing = false,
List<GeocoderPlaceType> types = const <GeocoderPlaceType>[],
}) async {
var url = this.endpoint + '/' + version;
var url = '${this.endpoint}/$version';

if (endpoint == GeocoderEndpoint.PLACES_PERMANENT) {
url += '/mapbox.places-permanent';
Expand Down Expand Up @@ -141,7 +141,7 @@ class ForwardGeocodingApi {
bool? routing,
List<GeocoderPlaceType>? types,
}) {
var url = '?access_token=' + api.accessToken!;
var url = '?access_token=${api.accessToken!}';

if (autocomplete != null && !autocomplete) {
url += '&autocomplete=false';
Expand All @@ -156,7 +156,7 @@ class ForwardGeocodingApi {
}

if (language != null) {
url += '&language=' + language;
url += '&language=$language';
}

if (limit != null && limit != 5) {
Expand Down
6 changes: 3 additions & 3 deletions lib/src/search/globals.dart
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,10 @@ class GeocodingApiResponse {
}

GeocodingApiResponse.fromJson(Map<String, dynamic> json) {
final _message = json['message'] as String?;
final message = json['message'] as String?;

if (_message != null) {
error = GeocoderError(message: _message);
if (message != null) {
error = GeocoderError(message: message);
}

type = json['type'] as String?;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/search/intersection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class IntersectionApi {
List<double> proximity = const <double>[],
List<GeocoderPlaceType> types = const <GeocoderPlaceType>[],
}) async {
var url = this.endpoint + '/' + version;
var url = '${this.endpoint}/$version';

if (endpoint == GeocoderEndpoint.PLACES_PERMANENT) {
url += '/mapbox.places-permanent';
Expand All @@ -33,7 +33,7 @@ class IntersectionApi {
}

url += '/$street1 and $street2.json';
url += '?access_token=' + api.accessToken!;
url += '?access_token=${api.accessToken!}';

if (types.isNotEmpty) {
for (var i = 0; i < types.length; i++) {
Expand Down
8 changes: 4 additions & 4 deletions lib/src/search/reverse_geocoding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ReverseGeocodingApi {
bool routing = false,
List<GeocoderPlaceType> types = const <GeocoderPlaceType>[],
}) async {
var url = this.endpoint + '/' + version;
var url = '${this.endpoint}/$version';

if (endpoint == GeocoderEndpoint.PLACES_PERMANENT) {
url += '/mapbox.places-permanent';
Expand Down Expand Up @@ -70,7 +70,7 @@ class ReverseGeocodingApi {
bool routing = false,
List<GeocoderPlaceType> types = const <GeocoderPlaceType>[],
}) async {
var url = this.endpoint + '/' + version;
var url = '${this.endpoint}/$version';

if (endpoint == GeocoderEndpoint.PLACES_PERMANENT) {
url += '/mapbox.places-permanent';
Expand Down Expand Up @@ -127,14 +127,14 @@ class ReverseGeocodingApi {
bool? routing,
List<GeocoderPlaceType>? types,
}) {
var url = '?access_token=' + api.accessToken!;
var url = '?access_token=${api.accessToken!}';

if (routing != null && routing) {
url += '&routing=true';
}

if (language != null) {
url += '&language=' + language;
url += '&language=$language';
}

if (limit != null && limit != 5) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:
http: ^1.2.0

dev_dependencies:
pedantic: ^1.9.2
lints: ^5.0.0

environment:
sdk: '>=2.12.0 <3.0.0'

0 comments on commit 44b72b6

Please sign in to comment.