How to modify plugins Dart code Flutter?

Here is step by step of how to modify plugin locally, my plugin named: flutter_abc-0.4.1

  1. Right click on package/plugin’s import file name, choose Reveal in Finder
    Or hold CMD + Click on that file name to go to that file, then Right click anywhere in the file and choose “Reveal in Finder”.

Normally it’s located at ~/.pub-cache/hosted/pub.dartlang.org/flutter_abc-0.4.1

  1. Copy whole package folder to your app folder

For easy hijacking files, just copy all to your app folder (same level with pubspec.yaml, not in the lib folder), then renaming version:

For example: flutter_abc-0.4.1-hijacking

Now you can modify whatever you want to fix bug locally.

  1. Modify pubspec.yaml to point to local package

Open your project pubspec.yaml
Change path of dependencies to, for example:

flutter_abc: path: ./flutter_abcd-0.4.1-hijacking/

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)