Closed airychkov closed 3 weeks ago
Hey
Probably this is not a freezed
feature but the feature of build runner
https://stackoverflow.com/questions/68190081/is-there-a-way-to-put-the-generated-files-in-a-separate-folder-in-flutter
https://github.com/rrousselGit/freezed/issues/633#issuecomment-1100594864
I did config like in guides
reactive_forms_generator: enabled: true options: build_extensions: 'lib/{{path}}/{{file}}.dart': 'lib/{{path}}/generated/{{file}}.gform.dart'
add in file part 'generated/xxx.gform.dart'; and get message: xxx.gform.dart must be included as a part directive in the input library with: part 'xxx.gform.dart';
your code for builder is different from freezed
and in your build.yaml different extention build_extensions: { '.dart': [ '.gr.dart' ] }. Not gform.
could you check if reactive_forms_generator 5.0.2 will help you
I copy-past form freezed builder.dart I don't know how it's work. =) I'm new in dart/flutter It's working as I want.
Builder reactiveFormsGenerator(BuilderOptions options) { return PartBuilder( [ReactiveFormsGenerator()], formatOutput: options.config['format'] == false ? (str) => str : null, '.gform.dart', header: ''' // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint ''', options: options, ); // return PartBuilder( // [const ReactiveFormsGenerator()],
// '.gform.dart', // header: ''' // // coverage:ignore-file // // GENERATED CODE - DO NOT MODIFY BY HAND // // ignore_for_file: type=lint // // ignore_for_file: // ''', // ); }
hey @airychkov probably options: options,
where missing
one moment I'll release new version
check reactive_forms_generator 5.0.4
Hey! it's working. Thank you
Hi @airychkov! Your issue has been closed. If we were helpful don't forget to star the repo.
Please check our reactive_forms_widget package
We would appreciate sponsorship subscription or one time donation https://github.com/sponsors/artflutter
Hello
Could you please add option to generate in specified folder? Like freezed.
from build.yaml
freezed: enabled: true options: build_extensions: 'lib/{{path}}/{{file}}.dart': 'lib/{{path}}/generated/{{file}}.freezed.dart'