Reputation: 762
I want to convert all absolute paths to relative paths in flutter without doing one by one. Is there any way to do so?
Upvotes: 3
Views: 1160
Reputation: 762
Finally, I am answering my own question. I found an awesome vs code extension called dart-import.
After installing this extension. you just need to open command pallet using ctrl+shift+P
and search for fix all import
and Enter
.
Upvotes: 1
Reputation: 1801
There's a tool available for that from Dart v2.12:
https://dart.dev/tools/dart-fix
In short:
First run with dart fix --dry-run
to see what's going to change.
If satisfied with results, run dart fix --apply
to apply all the changes seen in the dry run.
Upvotes: 1