This is a VS Code extension that sorts your dart / flutter imports with a single command. UsageThere are three ways to activate the extension:
FeaturesBy default, this extension will group your dart imports according to source and Sort On SaveYou can set the extension to sort your dart imports whenever you save your
current active document. This is set to Custom Sorting RulesYou can set your own sorting rules so that imports will be grouped and ordered according to your preference. How it worksThe sorting algorithm only looks at a certain part of the import statement, namely the parts between the quotes. Keep this in mind when writing your own rules. For example, the following:
is simplified to
See the following example:
Default Sorting RulesThe extension comes with the following default rules:
You project name is detected automatically from pubspec.yaml and replaces If you don't provide custom rules in settings.json, then the extension will use these rules by default. If you provide any configuration whatsoever, then the extension will use only your configuration, completely disregarding the defaults. Other Settings
Release NotesSee Changelog ContributionContact me at aziznal.dev@gmail.com. I'd love to collaborate! NoteConfiguration inspired by this extension (typescript import sorter) |