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
e6fbdb63
Unverified
Commit
e6fbdb63
authored
Apr 05, 2021
by
Mouad Debbar
Committed by
GitHub
Apr 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[web] Enable material text field tests on web (#79665)
parent
4e039a9a
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
123 additions
and
63 deletions
+123
-63
_platform_web.dart
packages/flutter/lib/src/foundation/_platform_web.dart
+18
-1
editable_text.dart
packages/flutter/lib/src/widgets/editable_text.dart
+3
-4
text_field_test.dart
packages/flutter/test/material/text_field_test.dart
+102
-58
No files found.
packages/flutter/lib/src/foundation/_platform_web.dart
View file @
e6fbdb63
...
...
@@ -3,6 +3,8 @@
// found in the LICENSE file.
import
'dart:html'
as
html
;
import
'dart:ui'
as
ui
;
import
'platform.dart'
as
platform
;
/// The dart:html implementation of [platform.defaultTargetPlatform].
...
...
@@ -10,9 +12,24 @@ platform.TargetPlatform get defaultTargetPlatform {
// To get a better guess at the targetPlatform we need to be able to reference
// the window, but that won't be available until we fix the platforms
// configuration for Flutter.
return
platform
.
debugDefaultTargetPlatformOverride
??
_browserPlatform
;
return
platform
.
debugDefaultTargetPlatformOverride
??
_testPlatform
??
_browserPlatform
;
}
final
platform
.
TargetPlatform
?
_testPlatform
=
()
{
platform
.
TargetPlatform
?
result
;
assert
(()
{
// This member is only available in the web's dart:ui implementation.
// ignore: undefined_prefixed_name
if
(
ui
.
debugEmulateFlutterTesterEnvironment
as
bool
)
{
result
=
platform
.
TargetPlatform
.
android
;
}
return
true
;
}());
return
result
;
}();
// Lazy-initialized and forever cached current browser platform.
//
// Computing the platform is expensive as it uses `window.matchMedia`, which
...
...
packages/flutter/lib/src/widgets/editable_text.dart
View file @
e6fbdb63
...
...
@@ -2706,10 +2706,9 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
String
text
=
_value
.
text
;
text
=
widget
.
obscuringCharacter
*
text
.
length
;
// Reveal the latest character in an obscured field only on mobile.
if
((
defaultTargetPlatform
==
TargetPlatform
.
android
||
defaultTargetPlatform
==
TargetPlatform
.
iOS
||
defaultTargetPlatform
==
TargetPlatform
.
fuchsia
)
&&
!
kIsWeb
)
{
if
(
defaultTargetPlatform
==
TargetPlatform
.
android
||
defaultTargetPlatform
==
TargetPlatform
.
iOS
||
defaultTargetPlatform
==
TargetPlatform
.
fuchsia
)
{
final
int
?
o
=
_obscureShowCharTicksPending
>
0
?
_obscureLatestCharIndex
:
null
;
if
(
o
!=
null
&&
o
>=
0
&&
o
<
text
.
length
)
...
...
packages/flutter/test/material/text_field_test.dart
View file @
e6fbdb63
This diff is collapsed.
Click to expand it.
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