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
120a1fc4
Unverified
Commit
120a1fc4
authored
Apr 29, 2019
by
Jonah Williams
Committed by
GitHub
Apr 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Fix text field selection toolbar under Opacity (#31097)" (#31800)
parent
e427c2dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
60 deletions
+0
-60
layer.dart
packages/flutter/lib/src/rendering/layer.dart
+0
-7
text_field_test.dart
packages/flutter/test/material/text_field_test.dart
+0
-53
No files found.
packages/flutter/lib/src/rendering/layer.dart
View file @
120a1fc4
...
...
@@ -1282,13 +1282,6 @@ class OpacityLayer extends ContainerLayer {
}
}
@override
void
applyTransform
(
Layer
child
,
Matrix4
transform
)
{
assert
(
child
!=
null
);
assert
(
transform
!=
null
);
transform
.
translate
(
offset
.
dx
,
offset
.
dy
);
}
@override
ui
.
EngineLayer
addToScene
(
ui
.
SceneBuilder
builder
,
[
Offset
layerOffset
=
Offset
.
zero
])
{
bool
enabled
=
firstChild
!=
null
;
// don't add this layer if there's no child
...
...
packages/flutter/test/material/text_field_test.dart
View file @
120a1fc4
...
...
@@ -3,7 +3,6 @@
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:io'
;
import
'dart:math'
as
math
;
import
'dart:ui'
as
ui
show
window
;
...
...
@@ -381,58 +380,6 @@ void main() {
expect
(
textField
.
cursorRadius
,
const
Radius
.
circular
(
3.0
));
});
testWidgets
(
'text field selection toolbar renders correctly inside opacity'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Scaffold
(
body:
Center
(
child:
Container
(
width:
100
,
height:
100
,
child:
const
Opacity
(
opacity:
0.5
,
child:
TextField
(
decoration:
InputDecoration
(
hintText:
'Placeholder'
),
),
),
),
),
),
),
);
await
tester
.
showKeyboard
(
find
.
byType
(
TextField
));
const
String
testValue
=
'A B C'
;
tester
.
testTextInput
.
updateEditingValue
(
const
TextEditingValue
(
text:
testValue
)
);
await
tester
.
pump
();
// The selectWordsInRange with SelectionChangedCause.tap seems to be needed to show the toolbar.
// (This is true even if we provide selection parameter to the TextEditingValue above.)
final
EditableTextState
state
=
tester
.
state
<
EditableTextState
>(
find
.
byType
(
EditableText
));
state
.
renderEditable
.
selectWordsInRange
(
from:
const
Offset
(
0
,
0
),
cause:
SelectionChangedCause
.
tap
);
expect
(
state
.
showToolbar
(),
true
);
// This is needed for the AnimatedOpacity to turn from 0 to 1 so the toolbar is visible.
await
tester
.
pump
();
await
tester
.
pump
(
const
Duration
(
seconds:
1
));
// Sanity check that the toolbar widget exists.
expect
(
find
.
text
(
'PASTE'
),
findsOneWidget
);
await
expectLater
(
// The toolbar exists in the Overlay above the MaterialApp.
find
.
byType
(
Overlay
),
matchesGoldenFile
(
'text_field_opacity_test.0.0.png'
),
skip:
!
Platform
.
isLinux
,
);
});
// TODO(hansmuller): restore these tests after the fix for #24876 has landed.
/*
testWidgets('cursor layout has correct width', (WidgetTester tester) async {
...
...
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