Skip to content

Commit 881879b

Browse files
committed
chore(core): static analysis fixes
1 parent 9f8bcb6 commit 881879b

22 files changed

+77
-67
lines changed

packages/flutter_form_builder/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## [7.2.1] - 23-May-2022
2+
* Fix bug where `FormBuilder.onChanged` is called before `setInternalFieldValue` is done
3+
14
## [7.2.0] - 19-May-2022
25
* Added new dropdown attributes: borderRadius, enableFeedback, alignment. Fixes #1011
36
* Added more date picker and time picker options

packages/flutter_form_builder/example/lib/code_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ class CodePage extends StatefulWidget {
1414
}) : super(key: key);
1515

1616
@override
17-
CodePageState createState() => CodePageState();
17+
State<CodePage> createState() => _CodePageState();
1818
}
1919

20-
class CodePageState extends State<CodePage> {
20+
class _CodePageState extends State<CodePage> {
2121
@override
2222
Widget build(BuildContext context) {
2323
return Scaffold(

packages/flutter_form_builder/example/lib/main.dart

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ class CompleteForm extends StatefulWidget {
2929
const CompleteForm({Key? key}) : super(key: key);
3030

3131
@override
32-
CompleteFormState createState() {
33-
return CompleteFormState();
32+
State<CompleteForm> createState() {
33+
return _CompleteFormState();
3434
}
3535
}
3636

37-
class CompleteFormState extends State<CompleteForm> {
37+
class _CompleteFormState extends State<CompleteForm> {
3838
bool autoValidate = true;
3939
bool readOnly = false;
4040
bool showSegmentedControl = true;
@@ -102,11 +102,12 @@ class CompleteFormState extends State<CompleteForm> {
102102
helperText: 'Helper text',
103103
hintText: 'Hint text',
104104
suffixIcon: IconButton(
105-
icon: const Icon(Icons.close),
106-
onPressed: () {
107-
_formKey.currentState!.fields['date_range']
108-
?.didChange(null);
109-
}),
105+
icon: const Icon(Icons.close),
106+
onPressed: () {
107+
_formKey.currentState!.fields['date_range']
108+
?.didChange(null);
109+
},
110+
),
110111
),
111112
),
112113
FormBuilderSlider(

packages/flutter_form_builder/example/lib/sources/complete_form.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ class CompleteForm extends StatefulWidget {
77
const CompleteForm({Key? key}) : super(key: key);
88

99
@override
10-
CompleteFormState createState() {
11-
return CompleteFormState();
10+
State<CompleteForm> createState() {
11+
return _CompleteFormState();
1212
}
1313
}
1414

15-
class CompleteFormState extends State<CompleteForm> {
15+
class _CompleteFormState extends State<CompleteForm> {
1616
bool autoValidate = true;
1717
bool readOnly = false;
1818
bool showSegmentedControl = true;

packages/flutter_form_builder/example/lib/sources/custom_fields.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ class CustomFields extends StatefulWidget {
66
const CustomFields({Key? key}) : super(key: key);
77

88
@override
9-
CustomFieldsState createState() => CustomFieldsState();
9+
State<CustomFields> createState() => _CustomFieldsState();
1010
}
1111

12-
class CustomFieldsState extends State<CustomFields> {
12+
class _CustomFieldsState extends State<CustomFields> {
1313
final _formKey = GlobalKey<FormBuilderState>();
1414
var options = ["Option 1", "Option 2", "Option 3"];
1515

packages/flutter_form_builder/example/lib/sources/signup_form.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ class SignupForm extends StatefulWidget {
66
const SignupForm({Key? key}) : super(key: key);
77

88
@override
9-
SignupFormState createState() => SignupFormState();
9+
State<SignupForm> createState() => _SignupFormState();
1010
}
1111

12-
class SignupFormState extends State<SignupForm> {
12+
class _SignupFormState extends State<SignupForm> {
1313
final _formKey = GlobalKey<FormBuilderState>();
1414
final _emailFieldKey = GlobalKey<FormBuilderFieldState>();
1515

packages/flutter_form_builder/example/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dependencies:
1616
path: ../../form_builder_validators/
1717
flutter_localizations:
1818
sdk: flutter
19+
intl: ^0.17.0
1920

2021
dev_dependencies:
2122
flutter_lints: ^2.0.1

packages/flutter_form_builder/lib/src/fields/form_builder_checkbox.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class FormBuilderCheckbox extends FormBuilderField<bool> {
112112
decoration: decoration,
113113
focusNode: focusNode,
114114
builder: (FormFieldState<bool?> field) {
115-
final state = field as FormBuilderCheckboxState;
115+
final state = field as _FormBuilderCheckboxState;
116116

117117
return InputDecorator(
118118
decoration: state.decoration,
@@ -144,8 +144,9 @@ class FormBuilderCheckbox extends FormBuilderField<bool> {
144144
);
145145

146146
@override
147-
FormBuilderCheckboxState createState() => FormBuilderCheckboxState();
147+
FormBuilderFieldState<FormBuilderCheckbox, bool> createState() =>
148+
_FormBuilderCheckboxState();
148149
}
149150

150-
class FormBuilderCheckboxState
151+
class _FormBuilderCheckboxState
151152
extends FormBuilderFieldState<FormBuilderCheckbox, bool> {}

packages/flutter_form_builder/lib/src/fields/form_builder_checkbox_group.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class FormBuilderCheckboxGroup<T> extends FormBuilderField<List<T>> {
7474
decoration: decoration,
7575
focusNode: focusNode,
7676
builder: (FormFieldState<List<T>?> field) {
77-
final state = field as FormBuilderCheckboxGroupState<T>;
77+
final state = field as _FormBuilderCheckboxGroupState<T>;
7878

7979
return InputDecorator(
8080
decoration: state.decoration,
@@ -113,9 +113,9 @@ class FormBuilderCheckboxGroup<T> extends FormBuilderField<List<T>> {
113113
);
114114

115115
@override
116-
FormBuilderCheckboxGroupState<T> createState() =>
117-
FormBuilderCheckboxGroupState<T>();
116+
FormBuilderFieldState<FormBuilderCheckboxGroup<T>, List<T>> createState() =>
117+
_FormBuilderCheckboxGroupState<T>();
118118
}
119119

120-
class FormBuilderCheckboxGroupState<T>
120+
class _FormBuilderCheckboxGroupState<T>
121121
extends FormBuilderFieldState<FormBuilderCheckboxGroup<T>, List<T>> {}

packages/flutter_form_builder/lib/src/fields/form_builder_choice_chips.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ class FormBuilderChoiceChip<T> extends FormBuilderField<T> {
292292
decoration: decoration,
293293
focusNode: focusNode,
294294
builder: (FormFieldState<T?> field) {
295-
final state = field as FormBuilderChoiceChipState<T>;
295+
final state = field as _FormBuilderChoiceChipState<T>;
296296

297297
return InputDecorator(
298298
decoration: state.decoration,
@@ -338,9 +338,9 @@ class FormBuilderChoiceChip<T> extends FormBuilderField<T> {
338338
});
339339

340340
@override
341-
FormBuilderChoiceChipState<T> createState() =>
342-
FormBuilderChoiceChipState<T>();
341+
FormBuilderFieldState<FormBuilderChoiceChip<T>, T> createState() =>
342+
_FormBuilderChoiceChipState<T>();
343343
}
344344

345-
class FormBuilderChoiceChipState<T>
345+
class _FormBuilderChoiceChipState<T>
346346
extends FormBuilderFieldState<FormBuilderChoiceChip<T>, T> {}

0 commit comments

Comments
 (0)