mirror of
https://github.com/flutter/packages.git
synced 2025-08-14 18:12:30 +08:00
[tool] Replace flutter format
(#6946)
`flutter format` is deprecated on `master`, and prints a warning saying to switch to `dart format` instead. This updates `format` to make that switch.
This commit is contained in:
@ -191,10 +191,8 @@ class FormatCommand extends PackageCommand {
|
||||
_getPathsWithExtensions(files, <String>{'.dart'});
|
||||
if (dartFiles.isNotEmpty) {
|
||||
print('Formatting .dart files...');
|
||||
// `flutter format` doesn't require the project to actually be a Flutter
|
||||
// project.
|
||||
final int exitCode = await _runBatched(flutterCommand, <String>['format'],
|
||||
files: dartFiles);
|
||||
final int exitCode =
|
||||
await _runBatched('dart', <String>['format'], files: dartFiles);
|
||||
if (exitCode != 0) {
|
||||
printError('Failed to format Dart files: exit code $exitCode.');
|
||||
throw ToolExit(_exitFlutterFormatFailed);
|
||||
|
Reference in New Issue
Block a user