Home > Back-end >  Flutter project not picking up local flutter package updates
Flutter project not picking up local flutter package updates

Time:12-01

Flutter 3.3.9

I created a flutter project and I reference it as a dependency in another flutter project like so:

      dev_dependencies:
          flutter_test:
            sdk: flutter
          my_utils:
            path: ../my_utils

When I added the local package to my project initially, I could see and debug the referenced local package just fine. I made updates to the my_utils package, did a "flutter pub get" in the project referencing my_utils, and the changes are not being picked up.

I added a new class to my_utils and it is not finding it in the other project.

I have this in analysis_options.yaml:

include: package:flutter_lints/flutter.yaml

linter:
  rules:
     depend_on_referenced_packages: false

Setting depend_on_referenced_packages to true didn't help.

How do I make my changes/updates in my_utils show in my referencing project?

Thanks

CodePudding user response:

did you export the files properly ? e.g files inside src/?

my_utils file structure should be like the following:

lib/
...src/
......my_impl.dart
...my_utils.dart

and in your my_utils.dart should contain the following:

export 'src/my_impl.dart';

I recommend you use melos for managing multi-package projects. it might solve your problem. Also with melos bootstrap, you get flutter pub get running in all packages with one command.

you can follow the installation from here

  • Related