Skip to content

Commit 93c4983

Browse files
style: apply new dart format
1 parent 7c167d3 commit 93c4983

File tree

125 files changed

+11141
-10073
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+11141
-10073
lines changed

lib/localization/l10n.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ class FormBuilderLocalizations {
3131
/// [GlobalWidgetsLocalizations.delegate] delegates.
3232
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =
3333
<LocalizationsDelegate<dynamic>>[
34-
delegate,
35-
GlobalMaterialLocalizations.delegate,
36-
GlobalCupertinoLocalizations.delegate,
37-
GlobalWidgetsLocalizations.delegate,
38-
];
34+
delegate,
35+
GlobalMaterialLocalizations.delegate,
36+
GlobalCupertinoLocalizations.delegate,
37+
GlobalWidgetsLocalizations.delegate,
38+
];
3939

4040
/// The supported locales.
4141
static const List<Locale> supportedLocales =
@@ -69,10 +69,10 @@ class FormBuilderLocalizationsDelegate
6969
}
7070

7171
@override
72-
bool isSupported(Locale locale) =>
73-
FormBuilderLocalizationsImpl.supportedLocales
74-
.map((Locale e) => e.languageCode)
75-
.contains(locale.languageCode);
72+
bool isSupported(Locale locale) => FormBuilderLocalizationsImpl
73+
.supportedLocales
74+
.map((Locale e) => e.languageCode)
75+
.contains(locale.languageCode);
7676

7777
@override
7878
bool shouldReload(FormBuilderLocalizationsDelegate old) => false;

lib/src/base_validator.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
abstract class BaseValidator<T> {
33
/// Creates a new instance of the validator.
44
const BaseValidator({String? errorText, this.checkNullOrEmpty = true})
5-
: _errorText = errorText;
5+
: _errorText = errorText;
66

77
/// Backing field for [errorText].
88
final String? _errorText;

lib/src/collection/contains_element_validator.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class ContainsElementValidator<T> extends TranslatedValidator<T> {
1515
/// Constructor for the contains element validator.
1616
const ContainsElementValidator(
1717
this.values, {
18+
1819
/// {@macro base_validator_error_text}
1920
super.errorText,
2021

lib/src/collection/max_length_validator.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class MaxLengthValidator<T> extends TranslatedValidator<T> {
1616
/// Constructor for the maximum length validator.
1717
const MaxLengthValidator(
1818
this.maxLength, {
19+
1920
/// {@macro base_validator_error_text}
2021
super.errorText,
2122

lib/src/collection/min_length_validator.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class MinLengthValidator<T> extends TranslatedValidator<T> {
1616
/// Constructor for the minimum length validator.
1717
const MinLengthValidator(
1818
this.minLength, {
19+
1920
/// {@macro base_validator_error_text}
2021
super.errorText,
2122

lib/src/collection/range_validator.dart

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,28 @@ class RangeValidator<T> extends TranslatedValidator<T> {
2828

2929
/// {@macro base_validator_null_check}
3030
super.checkNullOrEmpty,
31-
}) : _minValidator = MinValidator<T>(
32-
min,
33-
inclusive: inclusive,
34-
errorText: errorText,
35-
checkNullOrEmpty: checkNullOrEmpty,
36-
),
37-
_maxValidator = MaxValidator<T>(
38-
max,
39-
inclusive: inclusive,
40-
errorText: errorText,
41-
checkNullOrEmpty: checkNullOrEmpty,
42-
),
43-
_minLengthValidator = MinLengthValidator<T>(
44-
min.toInt(),
45-
errorText: errorText,
46-
checkNullOrEmpty: checkNullOrEmpty,
47-
),
48-
_maxLengthValidator = MaxLengthValidator<T>(
49-
max.toInt(),
50-
errorText: errorText,
51-
checkNullOrEmpty: checkNullOrEmpty,
52-
);
31+
}) : _minValidator = MinValidator<T>(
32+
min,
33+
inclusive: inclusive,
34+
errorText: errorText,
35+
checkNullOrEmpty: checkNullOrEmpty,
36+
),
37+
_maxValidator = MaxValidator<T>(
38+
max,
39+
inclusive: inclusive,
40+
errorText: errorText,
41+
checkNullOrEmpty: checkNullOrEmpty,
42+
),
43+
_minLengthValidator = MinLengthValidator<T>(
44+
min.toInt(),
45+
errorText: errorText,
46+
checkNullOrEmpty: checkNullOrEmpty,
47+
),
48+
_maxLengthValidator = MaxLengthValidator<T>(
49+
max.toInt(),
50+
errorText: errorText,
51+
checkNullOrEmpty: checkNullOrEmpty,
52+
);
5353

5454
/// The minimum value of the range.
5555
final num min;
@@ -80,10 +80,12 @@ class RangeValidator<T> extends TranslatedValidator<T> {
8080
String? validateValue(T valueCandidate) {
8181
final String? minResult = _minValidator.validate(valueCandidate);
8282
final String? maxResult = _maxValidator.validate(valueCandidate);
83-
final String? minLengthResult =
84-
_minLengthValidator.validate(valueCandidate);
85-
final String? maxLengthResult =
86-
_maxLengthValidator.validate(valueCandidate);
83+
final String? minLengthResult = _minLengthValidator.validate(
84+
valueCandidate,
85+
);
86+
final String? maxLengthResult = _maxLengthValidator.validate(
87+
valueCandidate,
88+
);
8789

8890
if ((minResult == null && maxResult == null) ||
8991
(minLengthResult == null && maxLengthResult == null)) {

lib/src/collection/unique_validator.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class UniqueValidator<T> extends TranslatedValidator<T> {
1414
/// Constructor for the unique value validator.
1515
const UniqueValidator(
1616
this.values, {
17+
1718
/// {@macro base_validator_error_text}
1819
super.errorText,
1920

lib/src/core/conditional_validator.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ import '../../form_builder_validators.dart';
1414
/// {@endtemplate}
1515
class ConditionalValidator<T> extends BaseValidator<T> {
1616
/// Constructor for the conditional validator.
17-
const ConditionalValidator(
18-
this.condition,
19-
this.validator,
20-
) : super(checkNullOrEmpty: false);
17+
const ConditionalValidator(this.condition, this.validator)
18+
: super(checkNullOrEmpty: false);
2119

2220
/// A function that returns a boolean indicating whether the validator should be applied.
2321
final bool Function(T? value) condition;

lib/src/core/default_value_validator.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import '../../form_builder_validators.dart';
1515
class DefaultValueValidator<T> extends BaseValidator<T> {
1616
/// Constructor for the default value validator.
1717
const DefaultValueValidator(this.defaultValue, this.validator)
18-
: super(checkNullOrEmpty: false);
18+
: super(checkNullOrEmpty: false);
1919

2020
/// The default value to use if the valueCandidate is null.
2121
final T defaultValue;

lib/src/core/equal_validator.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class EqualValidator<T> extends TranslatedValidator<T> {
1414
/// Constructor for the equal value validator.
1515
const EqualValidator(
1616
this.value, {
17+
1718
/// {@macro base_validator_error_text}
1819
super.errorText,
1920

0 commit comments

Comments
 (0)