Skip to content

Commit

Permalink
chore: upgrade to lints 3.0.0 (#822)
Browse files Browse the repository at this point in the history
  • Loading branch information
monsieurtanuki authored Nov 15, 2023
1 parent 415b07d commit 4d211dc
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 41 deletions.
3 changes: 1 addition & 2 deletions lib/src/model/parameter/allergens_parameter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ class AllergensParameter extends BoolMapParameter<AllergensTag> {
String getTag(final AllergensTag key, final bool value) =>
value ? key.offTag : '-${key.offTag}';

const AllergensParameter({required final Map<AllergensTag, bool> map})
: super(map: map);
const AllergensParameter({required super.map});
}
3 changes: 1 addition & 2 deletions lib/src/model/parameter/states_tags_parameter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ class StatesTagsParameter extends BoolMapParameter<ProductState> {
String getTag(final ProductState key, final bool value) =>
value ? key.completedTag : key.toBeCompletedTag;

StatesTagsParameter({required final Map<ProductState, bool> map})
: super(map: map);
const StatesTagsParameter({required super.map});
}
15 changes: 3 additions & 12 deletions lib/src/model/sign_up_status.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,10 @@ class SignUpStatus extends Status {
final Iterable<SignUpStatusError>? statusErrors;

SignUpStatus._({
dynamic status,
String? statusVerbose,
String? body,
String? error,
int? imageId,
super.status,
super.error,
this.statusErrors,
}) : super(
status: status,
statusVerbose: statusVerbose,
body: body,
error: error,
imageId: imageId,
);
});

factory SignUpStatus(Status status) {
if (status.body == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ class AvailablePreferenceImportances {
/// Returns the importance from its id.
PreferenceImportance? getPreferenceImportance(final String importanceId) =>
_preferenceImportances?[importanceId] ??
_preferenceImportances?[PreferenceImportance.INDEX_NOT_IMPORTANT];
_preferenceImportances?[PreferenceImportance.ID_NOT_IMPORTANT];
}
18 changes: 5 additions & 13 deletions lib/src/utils/product_query_configurations.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import 'package:http/http.dart';
import 'abstract_query_configuration.dart';
import 'country_helper.dart';
import 'http_helper.dart';
import 'language_helper.dart';
import 'product_fields.dart';
import 'uri_helper.dart';
import '../model/user.dart';

Expand Down Expand Up @@ -38,16 +35,11 @@ class ProductQueryConfiguration extends AbstractQueryConfiguration {
ProductQueryConfiguration(
this.barcode, {
required this.version,
final OpenFoodFactsLanguage? language,
final List<OpenFoodFactsLanguage> languages = const [],
final OpenFoodFactsCountry? country,
final List<ProductField>? fields,
}) : super(
language: language,
languages: languages,
country: country,
fields: fields,
);
super.language,
super.languages,
super.country,
super.fields,
});

/// If the provided [ProductQueryVersion] matches the API V3 requirements
bool matchesV3() => version.matchesV3();
Expand Down
14 changes: 4 additions & 10 deletions lib/src/utils/product_search_query_configuration.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import 'abstract_query_configuration.dart';
import 'country_helper.dart';
import 'language_helper.dart';
import 'product_fields.dart';
import 'product_query_configurations.dart';
import '../interface/parameter.dart';
Expand All @@ -10,17 +8,13 @@ class ProductSearchQueryConfiguration extends AbstractQueryConfiguration {
/// See [AbstractQueryConfiguration.languages] for
/// parameter's description.
ProductSearchQueryConfiguration({
final OpenFoodFactsLanguage? language,
final List<OpenFoodFactsLanguage> languages = const [],
final OpenFoodFactsCountry? country,
final List<ProductField>? fields,
super.language,
super.languages,
super.country,
super.fields,
required List<Parameter> parametersList,
required this.version,
}) : super(
language: language,
languages: languages,
country: country,
fields: fields,
additionalParameters: parametersList,
);

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dev_dependencies:
analyzer: ^6.0.0
build_runner: ^2.4.6
json_serializable: ^6.7.1
lints: ^2.0.1
lints: ^3.0.0
test: ^1.21.4
coverage: ^1.6.2

Expand Down

0 comments on commit 4d211dc

Please sign in to comment.