File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
packages/flutter/lib/src/foundation Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -68,4 +68,13 @@ const bool kDebugMode = !kReleaseMode && !kProfileMode;
6868const double precisionErrorTolerance = 1e-10 ;
6969
7070/// A constant that is true if the application was compiled to run on the web.
71+ ///
72+ /// See also:
73+ ///
74+ /// * [defaultTargetPlatform] , which is used by themes to find out which
75+ /// platform the application is running on (or, in the case of a web app,
76+ /// which platform the application's browser is running in). Can be overridden
77+ /// in tests with [debugDefaultTargetPlatformOverride] .
78+ /// * [dart:io.Platform] , a way to find out the browser's platform that is not
79+ /// overridable in tests.
7180const bool kIsWeb = bool .fromEnvironment ('dart.library.js_util' );
Original file line number Diff line number Diff line change @@ -26,6 +26,12 @@ import '_platform_io.dart'
2626///
2727/// Tests can also create specific platform tests by and adding a `variant:`
2828/// argument to the test and using a [TargetPlatformVariant] .
29+ ///
30+ /// See also:
31+ ///
32+ /// * [kIsWeb] , a boolean which is true if the application is running on the
33+ /// web, where [defaultTargetPlatform] returns which platform the browser is
34+ /// running on.
2935//
3036// When adding support for a new platform (e.g. Windows Phone, Raspberry Pi),
3137// first create a new value on the [TargetPlatform] enum, then add a rule for
You can’t perform that action at this time.
0 commit comments