-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61c6bb1
commit 1d44eed
Showing
14 changed files
with
853 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
packages/generator_tests/test/doc/animated_url_list_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
@Timeout(Duration(seconds: 145)) | ||
import 'package:test/test.dart'; | ||
|
||
import '../helpers.dart'; | ||
|
||
const fileName = 'animated_url_list'; | ||
|
||
void main() { | ||
group('reactive_forms_generator', () { | ||
test( | ||
'Animated URL list', | ||
() async { | ||
return testGenerator( | ||
fileName: fileName, | ||
model: ''' | ||
import 'package:flutter/material.dart'; | ||
import 'package:reactive_forms/reactive_forms.dart'; | ||
import 'package:reactive_forms_annotations/reactive_forms_annotations.dart'; | ||
@Rf() | ||
class UrlO { | ||
final List<UrlEntityO> urlList; | ||
UrlO({@RfArray() this.urlList = const []}); | ||
} | ||
@RfGroup() | ||
class UrlEntityO { | ||
final String? label; | ||
final String? url; | ||
UrlEntityO({ | ||
@RfControl(validators: [ | ||
RequiredValidator(), | ||
]) | ||
this.label, | ||
@RfControl(validators: [ | ||
RequiredValidator(), | ||
]) | ||
this.url, | ||
}); | ||
} | ||
''', | ||
generatedFile: generatedFile, | ||
); | ||
}, | ||
); | ||
}); | ||
} | ||
|
||
const generatedFile = r''' | ||
'''; |
27 changes: 27 additions & 0 deletions
27
packages/reactive_forms_generator/example/lib/docs/animated_url_list/url_output.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import 'package:reactive_forms_annotations/reactive_forms_annotations.dart'; | ||
|
||
part 'url_output.gform.dart'; | ||
|
||
@Rf() | ||
class UrlO { | ||
final List<UrlEntityO> urlList; | ||
|
||
UrlO({@RfArray() this.urlList = const []}); | ||
} | ||
|
||
@RfGroup() | ||
class UrlEntityO { | ||
final String? label; | ||
final String? url; | ||
|
||
UrlEntityO({ | ||
@RfControl(validators: [ | ||
RequiredValidator(), | ||
]) | ||
this.label, | ||
@RfControl(validators: [ | ||
RequiredValidator(), | ||
]) | ||
this.url, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.