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
62378a37
Unverified
Commit
62378a37
authored
Jun 24, 2020
by
chunhtai
Committed by
GitHub
Jun 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ink feature tries to get parent transformations when it is in the… (#60129)
parent
33777817
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
2 deletions
+69
-2
sliver_multi_box_adaptor.dart
...s/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart
+10
-2
tabs_test.dart
packages/flutter/test/material/tabs_test.dart
+59
-0
No files found.
packages/flutter/lib/src/rendering/sliver_multi_box_adaptor.dart
View file @
62378a37
...
...
@@ -584,8 +584,16 @@ abstract class RenderSliverMultiBoxAdaptor extends RenderSliver
}
@override
void
applyPaintTransform
(
RenderObject
child
,
Matrix4
transform
)
{
applyPaintTransformForBoxChild
(
child
as
RenderBox
,
transform
);
void
applyPaintTransform
(
RenderBox
child
,
Matrix4
transform
)
{
if
(
_keepAliveBucket
.
containsKey
(
indexOf
(
child
)))
{
// It is possible that widgets under kept alive children want to paint
// themselves. For example, the Material widget tries to paint all
// InkFeatures under its subtree as long as they are not disposed. In
// such case, we give it a zero transform to prevent them from painting.
transform
.
setZero
();
}
else
{
applyPaintTransformForBoxChild
(
child
,
transform
);
}
}
@override
...
...
packages/flutter/test/material/tabs_test.dart
View file @
62378a37
...
...
@@ -1059,6 +1059,43 @@ void main() {
expect
(
_mainTabController
.
index
,
2
);
});
testWidgets
(
'TabBarView can warp when child is kept alive and contains ink'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/57662.
final
TabController
controller
=
TabController
(
vsync:
const
TestVSync
(),
length:
3
,
);
await
tester
.
pumpWidget
(
boilerplate
(
child:
TabBarView
(
controller:
controller
,
children:
const
<
Widget
>[
Text
(
'Page 1'
),
Text
(
'Page 2'
),
KeepAliveInk
(
'Page 3'
),
],
),
),
);
expect
(
controller
.
index
,
equals
(
0
));
expect
(
find
.
text
(
'Page 1'
),
findsOneWidget
);
expect
(
find
.
text
(
'Page 3'
),
findsNothing
);
controller
.
index
=
2
;
await
tester
.
pumpAndSettle
();
expect
(
find
.
text
(
'Page 1'
),
findsNothing
);
expect
(
find
.
text
(
'Page 3'
),
findsOneWidget
);
controller
.
index
=
0
;
await
tester
.
pumpAndSettle
();
expect
(
find
.
text
(
'Page 1'
),
findsOneWidget
);
expect
(
find
.
text
(
'Page 3'
),
findsNothing
);
expect
(
tester
.
takeException
(),
isNull
);
});
testWidgets
(
'TabBarView scrolls end close to a new page with custom physics'
,
(
WidgetTester
tester
)
async
{
final
TabController
tabController
=
TabController
(
vsync:
const
TestVSync
(),
...
...
@@ -2634,3 +2671,25 @@ void main() {
expect
(
pageView
.
physics
.
toString
().
contains
(
'ClampingScrollPhysics'
),
isFalse
);
});
}
class
KeepAliveInk
extends
StatefulWidget
{
const
KeepAliveInk
(
this
.
title
,
{
Key
key
})
:
super
(
key:
key
);
final
String
title
;
@override
State
<
StatefulWidget
>
createState
()
{
return
_KeepAliveInkState
();
}
}
class
_KeepAliveInkState
extends
State
<
KeepAliveInk
>
with
AutomaticKeepAliveClientMixin
{
@override
Widget
build
(
BuildContext
context
)
{
super
.
build
(
context
);
return
Ink
(
child:
Text
(
widget
.
title
),
);
}
@override
bool
get
wantKeepAlive
=>
true
;
}
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