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
1e843bb6
Unverified
Commit
1e843bb6
authored
Jun 25, 2020
by
chunhtai
Committed by
GitHub
Jun 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix paint order of ink feature (#59108)
parent
82a6f9bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
1 deletion
+49
-1
app_bar.dart
packages/flutter/lib/src/material/app_bar.dart
+6
-1
app_bar_test.dart
packages/flutter/test/material/app_bar_test.dart
+43
-0
No files found.
packages/flutter/lib/src/material/app_bar.dart
View file @
1e843bb6
...
...
@@ -684,7 +684,12 @@ class _AppBarState extends State<AppBar> {
fit:
StackFit
.
passthrough
,
children:
<
Widget
>[
widget
.
flexibleSpace
,
appBar
,
// Creates a material widget to prevent the flexibleSpace from swallow
// the ink splash effect.
Material
(
type:
MaterialType
.
transparency
,
child:
appBar
,
),
],
);
}
...
...
packages/flutter/test/material/app_bar_test.dart
View file @
1e843bb6
...
...
@@ -10,6 +10,7 @@ import 'package:flutter/rendering.dart';
import
'package:flutter/services.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'../rendering/mock_canvas.dart'
;
import
'../widgets/semantics_tester.dart'
;
Widget
buildSliverAppBarApp
(
{
...
...
@@ -1103,6 +1104,48 @@ void main() {
expect
(
find
.
byIcon
(
Icons
.
menu
),
findsNothing
);
});
testWidgets
(
'AppBar ink splash draw on the correct canvas'
,
(
WidgetTester
tester
)
async
{
// This is a regression test for https://github.com/flutter/flutter/issues/58665
final
Key
key
=
UniqueKey
();
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Center
(
child:
AppBar
(
title:
const
Text
(
'Abc'
),
actions:
<
Widget
>[
IconButton
(
key:
key
,
icon:
const
Icon
(
Icons
.
add_circle
),
tooltip:
'First button'
,
onPressed:
()
{},
),
],
flexibleSpace:
DecoratedBox
(
decoration:
BoxDecoration
(
gradient:
LinearGradient
(
begin:
const
Alignment
(
0.0
,
-
1.0
),
end:
const
Alignment
(-
0.04
,
1.0
),
colors:
<
Color
>[
Colors
.
blue
.
shade500
,
Colors
.
blue
.
shade800
],
),
),
),
),
),
),
);
final
RenderObject
painter
=
tester
.
renderObject
(
find
.
descendant
(
of:
find
.
descendant
(
of:
find
.
byType
(
AppBar
),
matching:
find
.
byType
(
Stack
),
),
matching:
find
.
byType
(
Material
)
)
);
await
tester
.
tap
(
find
.
byKey
(
key
));
expect
(
painter
,
paints
..
save
()..
translate
()..
save
()..
translate
()..
circle
(
x:
24.0
,
y:
28.0
));
});
testWidgets
(
'AppBar handles loose children 0'
,
(
WidgetTester
tester
)
async
{
final
GlobalKey
key
=
GlobalKey
();
await
tester
.
pumpWidget
(
...
...
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