Remove duplicate global declaration of UserMessages (#142281)

Fixes https://github.com/flutter/flutter/issues/142286

This is a refactor. No code behavior changes should be observed.
This commit is contained in:
Andrew Kolos
2024-01-26 13:41:16 -08:00
committed by GitHub
parent 6d436dfaa5
commit 69c98bd960
14 changed files with 28 additions and 42 deletions

View File

@@ -2,18 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'context.dart';
import 'platform.dart';
/// Contains messages produced by Flutter tools.
/// Class containing some message strings that can be produced by Flutter tools.
//
// This allows partial reimplementations of the flutter tool to override
// certain messages.
// TODO(andrewkolos): It is unclear if this is worth keeping. See
// https://github.com/flutter/flutter/issues/125155.
UserMessages get userMessages => context.get<UserMessages>()!;
/// Class containing message strings that can be produced by Flutter tools.
class UserMessages {
// Messages used in multiple components.
String get flutterToolBugInstructions =>
@@ -211,11 +207,6 @@ class UserMessages {
'$consequence\n'
'To re-install $reinstallInstructions';
// Messages used in VsCodeValidator
String vsCodeVersion(String version) => 'version $version';
String vsCodeLocation(String location) => 'VS Code at $location';
String vsCodeFlutterExtensionMissing(String url) => 'Flutter extension not installed; install from\n$url';
// Messages used in VisualStudioValidator
String visualStudioVersion(String name, String version) => '$name version $version';
String visualStudioLocation(String location) => 'Visual Studio at $location';