File size: 1,584 Bytes
88b9d23 346a42c 88b9d23 346a42c 88b9d23 346a42c 88b9d23 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | // Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// @docImport 'package:flutter/foundation.dart';
library;
import 'dart:io';
/// Whether the test is running in a web browser compiled to JavaScript or WebAssembly.
///
/// See also:
///
/// * [kIsWeb], the equivalent constant in the `foundation` library.
const bool isBrowser = bool.fromEnvironment('dart.library.js_interop');
/// Whether the test is running on the Windows operating system.
///
/// This does not include tests compiled to JavaScript running in a browser on
/// the Windows operating system.
///
/// See also:
///
/// * [isBrowser], which reports true for tests running in browsers.
bool get isWindows {
if (isBrowser) {
return false;
}
return Platform.isWindows;
}
/// Whether the test is running on the macOS operating system.
///
/// This does not include tests compiled to JavaScript running in a browser on
/// the macOS operating system.
///
/// See also:
///
/// * [isBrowser], which reports true for tests running in browsers.
bool get isMacOS {
if (isBrowser) {
return false;
}
return Platform.isMacOS;
}
/// Whether the test is running on the Linux operating system.
///
/// This does not include tests compiled to JavaScript running in a browser on
/// the Linux operating system.
///
/// See also:
///
/// * [isBrowser], which reports true for tests running in browsers.
bool get isLinux {
if (isBrowser) {
return false;
}
return Platform.isLinux;
}
|