Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 4e7dbef

Browse files
authored
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...
1 parent ad72a45 commit 4e7dbef

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

packages/flutter_tools/lib/src/commands/create.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ class CreateCommand extends CreateBase {
434434
globals.printStatus('Wrote $generatedFileCount files.');
435435
globals.printStatus('\nAll done!');
436436
final String application =
437-
'${emptyArgument ? 'empty' : ''}${sampleCode != null ? 'sample' : ''} application';
437+
'${emptyArgument ? 'empty ' : ''}${sampleCode != null ? 'sample ' : ''}application';
438438
if (generatePackage) {
439439
final String relativeMainPath = globals.fs.path.normalize(globals.fs.path.join(
440440
relativeDirPath,
@@ -476,6 +476,10 @@ class CreateCommand extends CreateBase {
476476

477477
// Let them know a summary of the state of their tooling.
478478
globals.printStatus('''
479+
You can find general documentation for Flutter at: https://docs.flutter.dev/
480+
Detailed API documentation is available at: https://api.flutter.dev/
481+
If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev
482+
479483
In order to run your $application, type:
480484
481485
\$ cd $relativeAppPath

packages/flutter_tools/test/commands.shard/permeable/create_test.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,23 @@ void main() {
164164
'lib/main.dart',
165165
],
166166
);
167+
expect(logger.statusText, contains('In order to run your application, type:'));
168+
// check that we're telling them about documentation
169+
expect(logger.statusText, contains('https://docs.flutter.dev/'));
170+
expect(logger.statusText, contains('https://api.flutter.dev/'));
171+
// check that the tests run clean
167172
return _runFlutterTest(projectDir);
168173
}, overrides: <Type, Generator>{
169174
Pub: () => Pub(
170175
fileSystem: globals.fs,
171-
logger: globals.logger,
176+
logger: logger,
172177
processManager: globals.processManager,
173178
usage: globals.flutterUsage,
174179
botDetector: globals.botDetector,
175180
platform: globals.platform,
176181
stdio: mockStdio,
177182
),
183+
Logger: () => logger,
178184
});
179185

180186
testUsingContext('can create a skeleton (list/detail) app', () async {
@@ -597,7 +603,7 @@ void main() {
597603
platform: globals.platform,
598604
stdio: mockStdio,
599605
),
600-
Logger: ()=>logger,
606+
Logger: () => logger,
601607
});
602608

603609
testUsingContext('plugin example app depends on plugin', () async {

0 commit comments

Comments
 (0)