From 23d705c30b5a3aea7c73154704265b9a80f1a5ff Mon Sep 17 00:00:00 2001 From: Alex Melnyk <30177329+alex-melnyk@users.noreply.github.com> Date: Wed, 9 Jun 2021 01:58:01 +0300 Subject: [PATCH] Fix typo in create.dart (#82454) --- .../lib/src/commands/create.dart | 2 +- .../commands.shard/permeable/create_test.dart | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/flutter_tools/lib/src/commands/create.dart b/packages/flutter_tools/lib/src/commands/create.dart index 14a7025ee1..8cc9fdf31a 100644 --- a/packages/flutter_tools/lib/src/commands/create.dart +++ b/packages/flutter_tools/lib/src/commands/create.dart @@ -483,7 +483,7 @@ void _printPluginDirectoryLocationMessage(String pluginPath, String projectName, Your plugin code is in $relativePluginMain. -You example app code is in $relativeExampleMain. +Your example app code is in $relativeExampleMain. '''); if (platformsString != null && platformsString.isNotEmpty) { diff --git a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart index cb8a42914b..890f45afd3 100755 --- a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart @@ -2203,6 +2203,25 @@ void main() { FeatureFlags: () => TestFeatureFlags(isMacOSEnabled: true), }); + testUsingContext('flutter create . on and existing plugin should show "Your example app code in"', () async { + Cache.flutterRoot = '../..'; + + final CreateCommand command = CreateCommand(); + final CommandRunner runner = createTestCommandRunner(command); + final String projectDirPath = globals.fs.path.normalize(projectDir.absolute.path); + final String relativePluginPath = globals.fs.path.normalize(globals.fs.path.relative(projectDirPath)); + final String relativeExamplePath = globals.fs.path.normalize(globals.fs.path.join(relativePluginPath, 'example/lib/main.dart')); + + await runner.run(['create', '--no-pub', '--org=com.example', '--template=plugin', '--platforms=android', projectDir.path]); + expect(logger.statusText, contains('Your example app code is in $relativeExamplePath.\n')); + await runner.run(['create', '--no-pub', '--org=com.example', '--template=plugin', '--platforms=ios', projectDir.path]); + expect(logger.statusText, contains('Your example app code is in $relativeExamplePath.\n')); + await runner.run(['create', '--no-pub', projectDir.path]); + expect(logger.statusText, contains('Your example app code is in $relativeExamplePath.\n')); + }, overrides: { + Logger: () => logger, + }); + testUsingContext('flutter create -t plugin in an empty folder should not show pubspec.yaml updating suggestion', () async { Cache.flutterRoot = '../..';