| Index: lib/src/flutter.dart
|
| diff --git a/lib/src/flutter.dart b/lib/src/flutter.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..cb383e460db5191b1aa0ef8d2ae58938d27b9de1
|
| --- /dev/null
|
| +++ b/lib/src/flutter.dart
|
| @@ -0,0 +1,25 @@
|
| +// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +import 'dart:io';
|
| +
|
| +import 'package:path/path.dart' as p;
|
| +import 'package:pub_semver/pub_semver.dart';
|
| +
|
| +import 'io.dart';
|
| +
|
| +/// Whether the Flutter SDK is available.
|
| +final bool isAvailable = Platform.environment.containsKey("FLUTTER_ROOT");
|
| +
|
| +/// The path to the root directory of the Flutter SDK.
|
| +final String rootDirectory = Platform.environment["FLUTTER_ROOT"];
|
| +
|
| +/// The Flutter SDK's version number, or `null` if the Flutter SDK is
|
| +/// unavailable.
|
| +final version = () {
|
| + if (!isAvailable) return null;
|
| +
|
| + return new Version.parse(
|
| + readTextFile(p.join(rootDirectory, "version")).trim());
|
| +}();
|
|
|