I downloaded flutter with dart inside, and start coding on sublime text but when I press formatt code it gives me wrong message which is "formatter for this type file (dart) not found." but when I run this command "dart format . " in the directory the code will be formatted, my question is how can I format code inside sublime instead of write that command in cmd?
note:
- when I run
dart --versionin cmd it show its version but if I rundartfmt --versionit doesn't recognize it as well as I downloaded codeformatter package
If you are referring to the plugin formatter specifically, you can't, dart is not supported but you can easily implement it with the instructions on the git page.
If you don't know/want do it yourself just do this two things:
Create the file
${packages}/Formatter/modules/formatter_dartformat.pywith this code (the file is located in%APPDATA%/Sublime Text/Packages/Formatter/moduleson windows).Then add the module to the config file at
${packages}/User/Formatter.sublime-settings.