From 4e7dbefd929d43025d16c40da3db000a9dc8f91e Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Thu, 10 Nov 2022 14:13:52 -0800 Subject: [PATCH] Explicitly call out documentation links in "flutter create" (#114181) The recent survey suggests that some people are not finding documentation after they get started with Flutter, so let's just give them links right away. It might not help everyone but there's not really any downside so... --- packages/flutter_tools/lib/src/commands/create.dart | 6 +++++- .../test/commands.shard/permeable/create_test.dart | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/flutter_tools/lib/src/commands/create.dart b/packages/flutter_tools/lib/src/commands/create.dart index fd6006fa5e7..fc72baea884 100644 --- a/packages/flutter_tools/lib/src/commands/create.dart +++ b/packages/flutter_tools/lib/src/commands/create.dart @@ -434,7 +434,7 @@ class CreateCommand extends CreateBase { globals.printStatus('Wrote $generatedFileCount files.'); globals.printStatus('\nAll done!'); final String application = - '${emptyArgument ? 'empty' : ''}${sampleCode != null ? 'sample' : ''} application'; + '${emptyArgument ? 'empty ' : ''}${sampleCode != null ? 'sample ' : ''}application'; if (generatePackage) { final String relativeMainPath = globals.fs.path.normalize(globals.fs.path.join( relativeDirPath, @@ -476,6 +476,10 @@ class CreateCommand extends CreateBase { // Let them know a summary of the state of their tooling. globals.printStatus(''' +You can find general documentation for Flutter at: https://docs.flutter.dev/ +Detailed API documentation is available at: https://api.flutter.dev/ +If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev + In order to run your $application, type: \$ cd $relativeAppPath 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 e12508ee7b3..373cebd2a45 100644 --- a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart @@ -164,17 +164,23 @@ void main() { 'lib/main.dart', ], ); + expect(logger.statusText, contains('In order to run your application, type:')); + // check that we're telling them about documentation + expect(logger.statusText, contains('https://docs.flutter.dev/')); + expect(logger.statusText, contains('https://api.flutter.dev/')); + // check that the tests run clean return _runFlutterTest(projectDir); }, overrides: { Pub: () => Pub( fileSystem: globals.fs, - logger: globals.logger, + logger: logger, processManager: globals.processManager, usage: globals.flutterUsage, botDetector: globals.botDetector, platform: globals.platform, stdio: mockStdio, ), + Logger: () => logger, }); testUsingContext('can create a skeleton (list/detail) app', () async { @@ -597,7 +603,7 @@ void main() { platform: globals.platform, stdio: mockStdio, ), - Logger: ()=>logger, + Logger: () => logger, }); testUsingContext('plugin example app depends on plugin', () async {