File tree 5 files changed +7
-12
lines changed
5 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -68,10 +68,4 @@ const bool kDebugMode = !kReleaseMode && !kProfileMode;
68
68
const double precisionErrorTolerance = 1e-10 ;
69
69
70
70
/// A constant that is true if the application was compiled to run on the web.
71
- ///
72
- /// This implementation takes advantage of the fact that JavaScript does not
73
- /// support integers. In this environment, Dart's doubles and ints are
74
- /// backed by the same kind of object. Thus a double `0.0` is identical
75
- /// to an integer `0` . This is not true for Dart code running in AOT or on the
76
- /// VM.
77
- const bool kIsWeb = identical (0 , 0.0 );
71
+ const bool kIsWeb = bool .fromEnvironment ('dart.library.js_util' );
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import 'dart:developer';
8
8
import 'package:flutter/foundation.dart' ;
9
9
10
10
import '_background_isolate_binary_messenger_io.dart'
11
- if (dart.library.html ) '_background_isolate_binary_messenger_web.dart' ;
11
+ if (dart.library.js_util ) '_background_isolate_binary_messenger_web.dart' ;
12
12
13
13
import 'binary_messenger.dart' ;
14
14
import 'binding.dart' ;
@@ -17,7 +17,7 @@ import 'message_codec.dart';
17
17
import 'message_codecs.dart' ;
18
18
19
19
export '_background_isolate_binary_messenger_io.dart'
20
- if (dart.library.html ) '_background_isolate_binary_messenger_web.dart' ;
20
+ if (dart.library.js_util ) '_background_isolate_binary_messenger_web.dart' ;
21
21
22
22
export 'binary_messenger.dart' show BinaryMessenger;
23
23
export 'binding.dart' show RootIsolateToken;
Original file line number Diff line number Diff line change 2
2
// Use of this source code is governed by a BSD-style license that can be
3
3
// found in the LICENSE file.
4
4
5
- export '_platform_selectable_region_context_menu_io.dart' if (dart.library.html) '_platform_selectable_region_context_menu_web.dart' ;
5
+ export '_platform_selectable_region_context_menu_io.dart'
6
+ if (dart.library.js_util) '_platform_selectable_region_context_menu_web.dart' ;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import 'package:flutter_test/flutter_test.dart';
11
11
// Originally here: https://github.com/flutter/engine/pull/28808
12
12
void main () {
13
13
test ('Web library environment define exists' , () {
14
- expect (const bool .fromEnvironment ('dart.library.html ' ), isTrue);
14
+ expect (const bool .fromEnvironment ('dart.library.js_util ' ), isTrue);
15
15
expect (const bool .fromEnvironment ('dart.library.someFooLibrary' ), isFalse);
16
16
});
17
17
}
Original file line number Diff line number Diff line change 3
3
// found in the LICENSE file.
4
4
5
5
import '_network_image_web_test_io.dart'
6
- if (dart.library.html ) '_network_image_test_web.dart' ;
6
+ if (dart.library.js_util ) '_network_image_test_web.dart' ;
7
7
8
8
void main () {
9
9
runTests ();
You can’t perform that action at this time.
0 commit comments