Remove direct uses of LocalPlatform (#56605)

When `const LocalPlatform` is used immediately and not passed as a
dependency it does not have utility over the static properties from
`dart:io`. Remove these uses to reduce the noise around how the
instantiable `Platform` class is used.
This commit is contained in:
Nate Bosch
2020-05-11 12:59:29 -07:00
committed by GitHub
parent fab03bd1e2
commit 59a8ef3a21
4 changed files with 9 additions and 14 deletions

View File

@@ -2,14 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:io' hide Platform;
import 'dart:io';
import 'package:path/path.dart' as path;
import 'package:platform/platform.dart' show LocalPlatform;
/// The location of the Flutter root directory, based on the known location of
/// this script.
final Directory flutterRoot = Directory(path.dirname(const LocalPlatform().script.toFilePath())).parent.parent.parent.parent;
final Directory flutterRoot = Directory(path.dirname(Platform.script.toFilePath())).parent.parent.parent.parent;
/// Converts `FOO_BAR` to `fooBar`.
String shoutingToLowerCamel(String shouting) {