diff --git a/packages/sealed_countries/lib/src/model/country/submodels/world_country.dart b/packages/sealed_countries/lib/src/model/country/submodels/world_country.dart index 3f874884..9e8008e0 100644 --- a/packages/sealed_countries/lib/src/model/country/submodels/world_country.dart +++ b/packages/sealed_countries/lib/src/model/country/submodels/world_country.dart @@ -213,6 +213,7 @@ class WorldCountry extends Country factory WorldCountry.fromCodeNumeric( Object codeNumeric, [ Iterable? countries, + // ignore: avoid-non-empty-constructor-bodies, more clear for factory methods. ]) { if (countries == null) return codeNumericMap.findByCodeOrThrow(codeNumeric); final trimmedCode = codeNumeric.toUpperCaseIsoCode(); diff --git a/packages/sealed_countries/lib/src/model/regional_bloc/regional_bloc.dart b/packages/sealed_countries/lib/src/model/regional_bloc/regional_bloc.dart index 7d9afbc9..b78fadfb 100644 --- a/packages/sealed_countries/lib/src/model/regional_bloc/regional_bloc.dart +++ b/packages/sealed_countries/lib/src/model/regional_bloc/regional_bloc.dart @@ -40,6 +40,7 @@ class RegionalBloc extends WorldBloc { factory RegionalBloc.fromAcronym( Object acronym, [ Iterable? blocs, + // ignore: avoid-non-empty-constructor-bodies, more clear for factory methods. ]) { final string = acronym.toUpperCaseIsoCode(); if (blocs == null) return map[string]!; diff --git a/packages/sealed_currencies/lib/src/model/currency/submodels/fiat_currency.dart b/packages/sealed_currencies/lib/src/model/currency/submodels/fiat_currency.dart index 80cdfaa0..5180d9fa 100644 --- a/packages/sealed_currencies/lib/src/model/currency/submodels/fiat_currency.dart +++ b/packages/sealed_currencies/lib/src/model/currency/submodels/fiat_currency.dart @@ -152,6 +152,7 @@ class FiatCurrency extends Currency factory FiatCurrency.fromName( Object name, [ Iterable currencies = listExtended, + // ignore: avoid-non-empty-constructor-bodies, more clear for factory methods. ]) { final upperCaseName = name.toUpperCaseIsoCode(); diff --git a/packages/sealed_languages/lib/src/helpers/extensions/iso_standardized_string_extension.dart b/packages/sealed_languages/lib/src/helpers/extensions/iso_standardized_string_extension.dart index 92a17844..c513339d 100644 --- a/packages/sealed_languages/lib/src/helpers/extensions/iso_standardized_string_extension.dart +++ b/packages/sealed_languages/lib/src/helpers/extensions/iso_standardized_string_extension.dart @@ -108,13 +108,13 @@ extension IsoStandardizedStringExtension on String { T Function(String code)? regular, T Function(String code)? short, }) { - final code = minLength == maxLength + final code = (minLength == maxLength) ? maybeToValidIsoCode(exactLength: minLength) : maybeToValidIsoCode(maxLength: maxLength, minLength: minLength); if (code == null) return orElse(this); return code.length == IsoStandardized.codeShortLength - ? short?.call(code.toUpperCase()) ?? orElse(code) + ? (short?.call(code.toUpperCase()) ?? orElse(code)) : _onNumericOrRegular(code, orElse, regular: regular, numeric: numeric); } @@ -127,7 +127,7 @@ extension IsoStandardizedStringExtension on String { if (numeric == null && regular == null) return orElse(code); return RegExp("[a-z]", caseSensitive: false).hasMatch(code) - ? regular?.call(code) ?? orElse(code) - : numeric?.call(code) ?? orElse(code); + ? (regular?.call(code) ?? orElse(code)) + : (numeric?.call(code) ?? orElse(code)); } } diff --git a/packages/sealed_languages/lib/src/model/language/submodels/natural_language.dart b/packages/sealed_languages/lib/src/model/language/submodels/natural_language.dart index a1d11205..0a8c11dd 100644 --- a/packages/sealed_languages/lib/src/model/language/submodels/natural_language.dart +++ b/packages/sealed_languages/lib/src/model/language/submodels/natural_language.dart @@ -167,6 +167,7 @@ class NaturalLanguage extends Language factory NaturalLanguage.fromName( Object name, [ Iterable languages = list, + // ignore: avoid-non-empty-constructor-bodies, more clear for factory methods. ]) { final upperCaseName = name.toUpperCaseIsoCode(); diff --git a/packages/sealed_languages/lib/src/model/language_family/submodels/natural_language_family.dart b/packages/sealed_languages/lib/src/model/language_family/submodels/natural_language_family.dart index 50a5a93d..e7977be7 100644 --- a/packages/sealed_languages/lib/src/model/language_family/submodels/natural_language_family.dart +++ b/packages/sealed_languages/lib/src/model/language_family/submodels/natural_language_family.dart @@ -31,6 +31,7 @@ class NaturalLanguageFamily extends LanguageFamily { factory NaturalLanguageFamily.fromName( String name, [ Iterable families = list, + // ignore: avoid-non-empty-constructor-bodies, more clear for factory methods. ]) { assert(families.isNotEmpty, "`families` should not be empty!"); diff --git a/packages/sealed_languages/lib/src/model/script/submodels/script.dart b/packages/sealed_languages/lib/src/model/script/submodels/script.dart index db0d7e29..9ea4b6b5 100644 --- a/packages/sealed_languages/lib/src/model/script/submodels/script.dart +++ b/packages/sealed_languages/lib/src/model/script/submodels/script.dart @@ -52,6 +52,7 @@ class Script extends WritingSystem /// {@macro optional_instances_array_parameter} /// This method returns the [Script] instance that corresponds to the /// given code, or throws a [StateError] if no such instance exists. + // ignore: avoid-non-empty-constructor-bodies, more clear for factory methods. factory Script.fromCode(Object code, [Iterable