Add flutter widget-preview {start, clean} commands (#159510)
This is the initial tooling work for Flutter Widget Previews, adding two commands: `flutter widget-preview start` and `flutter widget-preview clean`. The `start` command currently only checks to see if `.dart_tool/widget_preview_scaffold/` exists and creates a new Flutter project using the widget_preview_scaffold template if one isn't found. The widget_preview_scaffold template currently only contains some placeholder files and will be updated to include additional code required by the scaffold. The `clean` command simply deletes `.dart_tool/widget_preview_scaffold/` if it's found. This change also includes some refactoring of the `create` command in order to share some project creation logic without requiring `flutter widget-preview start` to spawn a new process simply to run `flutter create -t widget_preview .dart_tool/widget_preview_scaffold`. Related issue: https://github.com/flutter/flutter/issues/115704 --------- Co-authored-by: Andrew Kolos <andrewrkolos@gmail.com>
This commit is contained in:
@@ -43,6 +43,7 @@ import 'src/commands/symbolize.dart';
|
||||
import 'src/commands/test.dart';
|
||||
import 'src/commands/update_packages.dart';
|
||||
import 'src/commands/upgrade.dart';
|
||||
import 'src/commands/widget_preview.dart';
|
||||
import 'src/devtools_launcher.dart';
|
||||
import 'src/features.dart';
|
||||
import 'src/globals.dart' as globals;
|
||||
@@ -250,6 +251,7 @@ List<FlutterCommand> generateCommands({
|
||||
verbose: verbose,
|
||||
nativeAssetsBuilder: globals.nativeAssetsBuilder,
|
||||
),
|
||||
WidgetPreviewCommand(),
|
||||
UpgradeCommand(verboseHelp: verboseHelp),
|
||||
SymbolizeCommand(
|
||||
stdio: globals.stdio,
|
||||
|
||||
Reference in New Issue
Block a user