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
7fd36910
Commit
7fd36910
authored
Aug 05, 2016
by
Adam Barth
Committed by
GitHub
Aug 05, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Heroes in flight shouldn't be interactive (#5246)
After this patch, they ignore pointers.
parent
326bb212
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
3 deletions
+76
-3
heroes.dart
packages/flutter/lib/src/widgets/heroes.dart
+5
-3
heroes_test.dart
packages/flutter/test/widget/heroes_test.dart
+71
-0
No files found.
packages/flutter/lib/src/widgets/heroes.dart
View file @
7fd36910
...
...
@@ -301,9 +301,11 @@ class _HeroQuestState implements HeroHandle {
size:
animationArea
.
size
,
child:
new
RotationTransition
(
turns:
currentTurns
.
animate
(
animation
),
child:
new
RepaintBoundary
(
key:
key
,
child:
child
child:
new
IgnorePointer
(
child:
new
RepaintBoundary
(
key:
key
,
child:
child
)
)
)
);
...
...
packages/flutter/test/widget/heroes_test.dart
View file @
7fd36910
...
...
@@ -176,4 +176,75 @@ void main() {
await
tester
.
pump
(
new
Duration
(
milliseconds:
10
));
await
tester
.
pump
(
new
Duration
(
seconds:
1
));
});
testWidgets
(
'Heroes are not interactive'
,
(
WidgetTester
tester
)
async
{
List
<
String
>
log
=
<
String
>[];
await
tester
.
pumpWidget
(
new
MaterialApp
(
home:
new
Center
(
child:
new
Hero
(
tag:
'foo'
,
child:
new
GestureDetector
(
onTap:
()
{
log
.
add
(
'foo'
);
},
child:
new
Container
(
width:
100.0
,
height:
100.0
,
child:
new
Text
(
'foo'
)
)
)
)
),
routes:
<
String
,
WidgetBuilder
>{
'/next'
:
(
BuildContext
context
)
{
return
new
Align
(
alignment:
FractionalOffset
.
topLeft
,
child:
new
Hero
(
tag:
'foo'
,
child:
new
GestureDetector
(
onTap:
()
{
log
.
add
(
'bar'
);
},
child:
new
Container
(
width:
100.0
,
height:
150.0
,
child:
new
Text
(
'bar'
)
)
)
)
);
}
}
));
expect
(
log
,
isEmpty
);
await
tester
.
tap
(
find
.
text
(
'foo'
));
expect
(
log
,
equals
(<
String
>[
'foo'
]));
log
.
clear
();
NavigatorState
navigator
=
tester
.
state
(
find
.
byType
(
Navigator
));
navigator
.
pushNamed
(
'/next'
);
expect
(
log
,
isEmpty
);
await
tester
.
tap
(
find
.
text
(
'foo'
));
expect
(
log
,
isEmpty
);
await
tester
.
pump
(
new
Duration
(
milliseconds:
10
));
await
tester
.
tap
(
find
.
text
(
'foo'
));
expect
(
log
,
isEmpty
);
await
tester
.
tap
(
find
.
text
(
'bar'
));
expect
(
log
,
isEmpty
);
await
tester
.
pump
(
new
Duration
(
milliseconds:
10
));
expect
(
find
.
text
(
'foo'
),
findsNothing
);
await
tester
.
tap
(
find
.
text
(
'bar'
));
expect
(
log
,
isEmpty
);
await
tester
.
pump
(
new
Duration
(
seconds:
1
));
expect
(
find
.
text
(
'foo'
),
findsNothing
);
await
tester
.
tap
(
find
.
text
(
'bar'
));
expect
(
log
,
equals
(<
String
>[
'bar'
]));
});
}
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