Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
07c5ebca
Unverified
Commit
07c5ebca
authored
Oct 04, 2022
by
joshualitt
Committed by
GitHub
Oct 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[web] Fix `kIsWeb` for Dart2wasm. (#112122)
parent
90d79aa3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
12 deletions
+7
-12
constants.dart
packages/flutter/lib/src/foundation/constants.dart
+1
-7
platform_channel.dart
packages/flutter/lib/src/services/platform_channel.dart
+2
-2
platform_selectable_region_context_menu.dart
.../src/widgets/platform_selectable_region_context_menu.dart
+2
-1
browser_environment_test.dart
packages/flutter/test/dart/browser_environment_test.dart
+1
-1
network_image_web_test.dart
packages/flutter/test/painting/network_image_web_test.dart
+1
-1
No files found.
packages/flutter/lib/src/foundation/constants.dart
View file @
07c5ebca
...
...
@@ -68,10 +68,4 @@ const bool kDebugMode = !kReleaseMode && !kProfileMode;
const
double
precisionErrorTolerance
=
1
e
-
10
;
/// A constant that is true if the application was compiled to run on the web.
///
/// This implementation takes advantage of the fact that JavaScript does not
/// support integers. In this environment, Dart's doubles and ints are
/// backed by the same kind of object. Thus a double `0.0` is identical
/// to an integer `0`. This is not true for Dart code running in AOT or on the
/// VM.
const
bool
kIsWeb
=
identical
(
0
,
0.0
);
const
bool
kIsWeb
=
bool
.
fromEnvironment
(
'dart.library.js_util'
);
packages/flutter/lib/src/services/platform_channel.dart
View file @
07c5ebca
...
...
@@ -8,7 +8,7 @@ import 'dart:developer';
import
'package:flutter/foundation.dart'
;
import
'_background_isolate_binary_messenger_io.dart'
if
(
dart
.
library
.
htm
l
)
'_background_isolate_binary_messenger_web.dart'
;
if
(
dart
.
library
.
js_uti
l
)
'_background_isolate_binary_messenger_web.dart'
;
import
'binary_messenger.dart'
;
import
'binding.dart'
;
...
...
@@ -17,7 +17,7 @@ import 'message_codec.dart';
import
'message_codecs.dart'
;
export
'_background_isolate_binary_messenger_io.dart'
if
(
dart
.
library
.
htm
l
)
'_background_isolate_binary_messenger_web.dart'
;
if
(
dart
.
library
.
js_uti
l
)
'_background_isolate_binary_messenger_web.dart'
;
export
'binary_messenger.dart'
show
BinaryMessenger
;
export
'binding.dart'
show
RootIsolateToken
;
...
...
packages/flutter/lib/src/widgets/platform_selectable_region_context_menu.dart
View file @
07c5ebca
...
...
@@ -2,4 +2,5 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
export
'_platform_selectable_region_context_menu_io.dart'
if
(
dart
.
library
.
html
)
'_platform_selectable_region_context_menu_web.dart'
;
export
'_platform_selectable_region_context_menu_io.dart'
if
(
dart
.
library
.
js_util
)
'_platform_selectable_region_context_menu_web.dart'
;
packages/flutter/test/dart/browser_environment_test.dart
View file @
07c5ebca
...
...
@@ -11,7 +11,7 @@ import 'package:flutter_test/flutter_test.dart';
// Originally here: https://github.com/flutter/engine/pull/28808
void
main
(
)
{
test
(
'Web library environment define exists'
,
()
{
expect
(
const
bool
.
fromEnvironment
(
'dart.library.
htm
l'
),
isTrue
);
expect
(
const
bool
.
fromEnvironment
(
'dart.library.
js_uti
l'
),
isTrue
);
expect
(
const
bool
.
fromEnvironment
(
'dart.library.someFooLibrary'
),
isFalse
);
});
}
packages/flutter/test/painting/network_image_web_test.dart
View file @
07c5ebca
...
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
import
'_network_image_web_test_io.dart'
if
(
dart
.
library
.
htm
l
)
'_network_image_test_web.dart'
;
if
(
dart
.
library
.
js_uti
l
)
'_network_image_test_web.dart'
;
void
main
(
)
{
runTests
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment