How to pre populate generated files in Code Magic for flutter

573 Views Asked by At

I am trying to use object box in flutter application. It gives two files on pub run one objectbox.g.dart and other one objectbox-model.json.

The former file is ignored in gitignore.

Now that we are trying to use Code Magic to implement CD, we are facing the problem as generated file is not available in Code magic cloud. How to let Code Magic use this generated file. Also, how to update it when this file changes.

1

There are 1 best solutions below

2
On

You should add the code generation task to your codemagic.yaml:

workflows:
  default-workflow:
    [...]
    scripts:
      [...]
       - flutter packages pub get
       - flutter pub run build_runner build
      [...]
[...]