Skip to content

Commit

Permalink
default value handling
Browse files Browse the repository at this point in the history
  • Loading branch information
vasilich6107 committed Jan 11, 2025
1 parent fb26799 commit f6200d6
Show file tree
Hide file tree
Showing 61 changed files with 874 additions and 633 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void main() {
group('reactive_forms_generator', () {
test(
'Animated URL list Output',
() async {
() async {
return testGenerator(
fileName: fileName,
model: '''
Expand Down Expand Up @@ -327,7 +327,7 @@ class AnimatedUrlLisOForm
final toAdd = <UrlEntityO>[];
localValue.asMap().forEach((k, v) {
final values = (urlListControl.controls).map((e) => e.value).toList();
final values = urlListControl.controls.map((e) => e.value).toList();
if (urlListUrlEntityOForm.asMap().containsKey(k) &&
values.asMap().containsKey(k)) {
Expand Down Expand Up @@ -358,7 +358,7 @@ class AnimatedUrlLisOForm
bool updateParent = true,
bool emitEvent = true,
}) {
final values = (urlListControl.controls).map((e) => e.value).toList();
final values = urlListControl.controls.map((e) => e.value).toList();
if (values.length < i) {
addUrlListItem(value);
return;
Expand Down Expand Up @@ -420,7 +420,7 @@ class AnimatedUrlLisOForm
form.control(urlListControlPath()) as FormArray<Map<String, Object?>>;
List<UrlEntityOForm> get urlListUrlEntityOForm {
final values = (urlListControl.controls).map((e) => e.value).toList();
final values = urlListControl.controls.map((e) => e.value).toList();
return values
.asMap()
Expand Down
10 changes: 5 additions & 5 deletions packages/generator_tests/test/doc/animated_url_list_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ void main() {
@RfControl(validators: [
RequiredValidator(),
])
this.label = '',
this.label = "",
@RfControl(validators: [
RequiredValidator(),
])
this.url = '',
this.url = "",
});
}
''',
Expand Down Expand Up @@ -327,7 +327,7 @@ class AnimatedUrlListForm
final toAdd = <UrlEntity>[];
localValue.asMap().forEach((k, v) {
final values = (urlListControl.controls).map((e) => e.value).toList();
final values = urlListControl.controls.map((e) => e.value).toList();
if (urlListUrlEntityForm.asMap().containsKey(k) &&
values.asMap().containsKey(k)) {
Expand Down Expand Up @@ -358,7 +358,7 @@ class AnimatedUrlListForm
bool updateParent = true,
bool emitEvent = true,
}) {
final values = (urlListControl.controls).map((e) => e.value).toList();
final values = urlListControl.controls.map((e) => e.value).toList();
if (values.length < i) {
addUrlListItem(value);
return;
Expand Down Expand Up @@ -419,7 +419,7 @@ class AnimatedUrlListForm
form.control(urlListControlPath()) as FormArray<Map<String, Object?>>;
List<UrlEntityForm> get urlListUrlEntityForm {
final values = (urlListControl.controls).map((e) => e.value).toList();
final values = urlListControl.controls.map((e) => e.value).toList();
return values
.asMap()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void main() {
group('reactive_forms_generator', () {
test(
'Form with annotateless fields',
() async {
() async {
return testGenerator(
fileName: fileName,
model: '''
Expand All @@ -26,8 +26,8 @@ void main() {
final String password;
const AnnotatelessO({
@RfControl() this.email = '',
this.password = '',
@RfControl() this.email = "",
this.password = "",
});
@override
Expand Down Expand Up @@ -560,7 +560,7 @@ class AnnotatelessOForm
class AnnotatelessOOutput extends Equatable {
final String email;
final String password;
const AnnotatelessOOutput({@RfControl() this.email = '', this.password = ''});
const AnnotatelessOOutput({@RfControl() this.email = "", this.password = ""});
@override
List<Object?> get props => [email, password];
}
Expand Down
4 changes: 2 additions & 2 deletions packages/generator_tests/test/doc/annotateless_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ void main() {
final String password;
const Annotateless({
@RfControl() this.email = '',
this.password = '',
@RfControl() this.email = "",
this.password = "",
});
}
''',
Expand Down
Loading

0 comments on commit f6200d6

Please sign in to comment.