You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The formatter for Dart is in the Dart extension (since it should work for non-Flutter users too), so if you're setting the formatter explicitly for Dart you should set it to Dart-Code.dart-code.
That said, this formatter can *only format Dart, so you shouldn't set it as the default formatter for all lanuguages, as it will prevent you from being able to format other languages.
Unless you have good reason, you should be able to just delete that line from your settings - VS Code will use the Dart formatter for Dart files automatically without any specific configuration.
Let me know if this doesn't seem to work for you. Thanks!
thecodepapaya, zlyfer, vaibhavcs99, nicholaszuccarelli, juliands28 and 10 morecaospi, asai569, elkhayder, shahabmehr and Arenukvernjuliands28, asai569, elkhayder and shahabmehrshahabmehr
Sorry, it seems like there were two issues described and I only covered the first. The initial error saying Flutter can't format was for the reason I gave above. Trailing commas are the correct way to force the specific formatting you wanted - there's a little more info about this on the Flutter website here:
The formatter for Dart is in the Dart extension (since it should work for non-Flutter users too), so if you're setting the formatter explicitly for Dart you should set it to Dart-Code.dart-code.
That said, this formatter can *only format Dart, so you shouldn't set it as the default formatter for all lanuguages, as it will prevent you from being able to format other languages.
Unless you have good reason, you should be able to just delete that line from your settings - VS Code will use the Dart formatter for Dart files automatically without any specific configuration.
Let me know if this doesn't seem to work for you. Thanks!
Thank You, this is working for me now!
juliands28, realryankim, userThiagoRamos and kprathap23
Activity
DanTup commentedon Mar 15, 2020
The formatter for Dart is in the Dart extension (since it should work for non-Flutter users too), so if you're setting the formatter explicitly for Dart you should set it to
Dart-Code.dart-code
.That said, this formatter can *only format Dart, so you shouldn't set it as the default formatter for all lanuguages, as it will prevent you from being able to format other languages.
Unless you have good reason, you should be able to just delete that line from your settings - VS Code will use the Dart formatter for Dart files automatically without any specific configuration.
Let me know if this doesn't seem to work for you. Thanks!
Liqiankun commentedon Mar 15, 2020
@DanTup Thanks for the reply! But It doesn't work for me.
Liqiankun commentedon Mar 15, 2020
@DanTup I figured it out. I should add
,
afterLinearGradient()
!DanTup commentedon Mar 17, 2020
Sorry, it seems like there were two issues described and I only covered the first. The initial error saying Flutter can't format was for the reason I gave above. Trailing commas are the correct way to force the specific formatting you wanted - there's a little more info about this on the Flutter website here:
https://flutter.dev/docs/development/tools/formatting#using-trailing-commas
vaibhavcs99 commentedon Dec 16, 2020
Thank You, this is working for me now!