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...
This commit is contained in:
Ian Hickson 2022-11-10 14:13:52 -08:00 committed by GitHub
parent ad72a452b2
commit 4e7dbefd92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -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

View File

@ -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: <Type, Generator>{
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 {