diff --git a/packages/flutter_tools/lib/src/features.dart b/packages/flutter_tools/lib/src/features.dart index 82cdd55083cb..41cdf617a381 100644 --- a/packages/flutter_tools/lib/src/features.dart +++ b/packages/flutter_tools/lib/src/features.dart @@ -156,12 +156,14 @@ const Feature flutterWebWasm = Feature( ), ); +const String kCliAnimationsFeatureName = 'cli-animations'; + /// The [Feature] for CLI animations. /// /// The TERM environment variable set to "dumb" turns this off. const Feature cliAnimation = Feature.fullyEnabled( name: 'animations in the command line interface', - configSetting: 'cli-animations', + configSetting: kCliAnimationsFeatureName, ); /// Enable native assets compilation and bundling. diff --git a/packages/flutter_tools/lib/src/reporting/first_run.dart b/packages/flutter_tools/lib/src/reporting/first_run.dart index 0e2b0caab7ff..a670dc3c0279 100644 --- a/packages/flutter_tools/lib/src/reporting/first_run.dart +++ b/packages/flutter_tools/lib/src/reporting/first_run.dart @@ -36,7 +36,8 @@ const String _kFlutterFirstRunMessage = ''' ║ See Google's privacy policy: ║ ║ https://policies.google.com/privacy ║ ║ ║ - ║ To disable animations in this tool, use 'flutter config --no-animations'. ║ + ║ To disable animations in this tool, use ║ + ║ 'flutter config --no-cli-animations'. ║ ╚════════════════════════════════════════════════════════════════════════════╝ '''; diff --git a/packages/flutter_tools/test/general.shard/reporting/first_run_test.dart b/packages/flutter_tools/test/general.shard/reporting/first_run_test.dart index 4fd04e8a2c85..95af4a90d73e 100644 --- a/packages/flutter_tools/test/general.shard/reporting/first_run_test.dart +++ b/packages/flutter_tools/test/general.shard/reporting/first_run_test.dart @@ -4,6 +4,7 @@ import 'package:file/memory.dart'; import 'package:flutter_tools/src/base/logger.dart'; +import 'package:flutter_tools/src/features.dart'; import 'package:flutter_tools/src/persistent_tool_state.dart'; import 'package:flutter_tools/src/reporting/first_run.dart'; @@ -16,6 +17,12 @@ void main() { expect(messenger.licenseTerms, contains('Welcome to Flutter')); }); + testWithoutContext('FirstRunMessenger informs user how to disable animations', () { + final FirstRunMessenger messenger = setUpFirstRunMessenger(redisplayWelcomeMessage: false); + + expect(messenger.licenseTerms, contains('flutter config --no-$kCliAnimationsFeatureName')); + }); + testWithoutContext('FirstRunMessenger requires redisplay if it has never been run before', () { final FirstRunMessenger messenger = setUpFirstRunMessenger();