From 40f71c13b79b28129b380e83b31a92bf5dfd8327 Mon Sep 17 00:00:00 2001 From: Renan <6718144+renancaraujo@users.noreply.github.com> Date: Tue, 28 Mar 2023 17:33:20 +0100 Subject: [PATCH] feat: add wear os template to the create command (#694) * feat: add wear os template to the create command * wear template * default teamplte name to first template --- .../create/commands/create_subcommand.dart | 9 +- .../commands/create/commands/flutter_app.dart | 11 +- .../commands/create/templates/templates.dart | 1 + .../very_good_wear_app.dart | 2 + .../very_good_wear_app_bundle.dart | 704 ++++++++++++++++++ .../very_good_wear_app_template.dart | 32 + .../helpers/test_multi_template_commands.dart | 59 ++ .../create/commands/flutter_app_test.dart | 122 ++- .../create/create_subcommand_test.dart | 6 - tool/generate_bundles.sh | 1 + 10 files changed, 866 insertions(+), 81 deletions(-) create mode 100644 lib/src/commands/create/templates/very_good_wear_app/very_good_wear_app.dart create mode 100644 lib/src/commands/create/templates/very_good_wear_app/very_good_wear_app_bundle.dart create mode 100644 lib/src/commands/create/templates/very_good_wear_app/very_good_wear_app_template.dart create mode 100644 test/helpers/test_multi_template_commands.dart diff --git a/lib/src/commands/create/commands/create_subcommand.dart b/lib/src/commands/create/commands/create_subcommand.dart index d9439987..38d84b15 100644 --- a/lib/src/commands/create/commands/create_subcommand.dart +++ b/lib/src/commands/create/commands/create_subcommand.dart @@ -287,15 +287,16 @@ mixin OrgName on CreateSubCommand { /// Mixin for [CreateSubCommand] subclasses that receives multiple templates. /// -/// Subcommands that mix with this mixin should override [templates] and -/// [defaultTemplateName]; +/// Subcommands that mix with this mixin should override [templates]. /// /// Takes care of parsing the desired template from [argResults] and /// validating the org name. mixin MultiTemplates on CreateSubCommand { /// Gets the desired template to be created during a command run when the - /// template argument is not provided.` - String get defaultTemplateName; + /// template argument is not provided. + /// + /// Defaults to the first template in [templates]. + String get defaultTemplateName => templates.first.name; /// Gets all the templates to be created during a command run. List