I am using a build_runner to generate auto-generated code in the flutter project.
Issue: When I make an update in the model class and then I try to run below command, but it does not update auto-generated class.
Command:
pub run build_runner build
Dart Packages:
built_value: '>=5.5.5 <7.0.0'
build_runner: ^1.5.0
built_value_generator: ^6.6.0
After the execution of the command for build_runner, an auto-generated class should be updated.
When it conflicts with current generated classes, it may possible that it will not update the generated classes. So I have tested with below command and it's working fine.
flutter packages pub run build_runner build --delete-conflicting-outputs
This will delete current conflict files and recreate as per the requirements.
You need to use the watch
sub-command to Continuous generation of code.
flutter packages pub run build_runner watch
It runs a persistent build server that watches the files system for edits and does rebuilds as necessary.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With