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
fc0235ff
Unverified
Commit
fc0235ff
authored
Aug 02, 2022
by
Kate Lovett
Committed by
GitHub
Aug 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Fix ExpansionTile shows children background when expanded" (#108844)
parent
4b25e80c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
55 deletions
+5
-55
expansion_tile.dart
packages/flutter/lib/src/material/expansion_tile.dart
+5
-8
expansion_tile_test.dart
packages/flutter/test/material/expansion_tile_test.dart
+0
-47
No files found.
packages/flutter/lib/src/material/expansion_tile.dart
View file @
fc0235ff
...
...
@@ -10,7 +10,6 @@ import 'expansion_tile_theme.dart';
import
'icons.dart'
;
import
'list_tile.dart'
;
import
'list_tile_theme.dart'
;
import
'material.dart'
;
import
'theme.dart'
;
const
Duration
_kExpand
=
Duration
(
milliseconds:
200
);
...
...
@@ -433,13 +432,11 @@ class _ExpansionTileState extends State<ExpansionTile> with SingleTickerProvider
offstage:
closed
,
child:
TickerMode
(
enabled:
!
closed
,
child:
Material
(
child:
Padding
(
padding:
widget
.
childrenPadding
??
expansionTileTheme
.
childrenPadding
??
EdgeInsets
.
zero
,
child:
Column
(
crossAxisAlignment:
widget
.
expandedCrossAxisAlignment
??
CrossAxisAlignment
.
center
,
children:
widget
.
children
,
),
child:
Padding
(
padding:
widget
.
childrenPadding
??
expansionTileTheme
.
childrenPadding
??
EdgeInsets
.
zero
,
child:
Column
(
crossAxisAlignment:
widget
.
expandedCrossAxisAlignment
??
CrossAxisAlignment
.
center
,
children:
widget
.
children
,
),
),
),
...
...
packages/flutter/test/material/expansion_tile_test.dart
View file @
fc0235ff
...
...
@@ -5,8 +5,6 @@
import
'package:flutter/material.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'../rendering/mock_canvas.dart'
;
class
TestIcon
extends
StatefulWidget
{
const
TestIcon
({
super
.
key
});
...
...
@@ -483,51 +481,6 @@ void main() {
expect
(
columnRect
.
bottom
,
paddingRect
.
bottom
-
4
);
});
testWidgets
(
'ExpansionTile adds a Material widget above its children when expanded'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/107030
const
Color
childColor
=
Color
(
0xff4caf50
);
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
Material
(
child:
Center
(
child:
ExpansionTile
(
title:
Text
(
'title'
),
childrenPadding:
EdgeInsets
.
fromLTRB
(
10
,
8
,
12
,
4
),
children:
<
Widget
>[
ListTile
(
tileColor:
childColor
),
],
),
),
),
),
);
final
Finder
rootMaterialFinder
=
find
.
ancestor
(
of:
find
.
byType
(
ExpansionTile
),
matching:
find
.
byType
(
Material
),
);
final
Finder
expansionTileMaterialFinder
=
find
.
descendant
(
of:
find
.
byType
(
ExpansionTile
),
matching:
find
.
byType
(
Material
),
);
// ExpansionTile should not add a Material widget when it is not expanded
expect
(
expansionTileMaterialFinder
,
findsNothing
);
// Expand
await
tester
.
tap
(
find
.
text
(
'title'
));
await
tester
.
pumpAndSettle
();
// ExpansionTile adds a Material widget when it is expanded
expect
(
expansionTileMaterialFinder
,
findsOneWidget
);
// Child color is painted on the inner Material widget
expect
(
rootMaterialFinder
,
isNot
(
paints
..
path
()..
path
(
color:
childColor
)));
expect
(
expansionTileMaterialFinder
,
paints
..
path
(
color:
childColor
));
});
testWidgets
(
'ExpansionTile.collapsedBackgroundColor'
,
(
WidgetTester
tester
)
async
{
const
Key
expansionTileKey
=
Key
(
'expansionTileKey'
);
const
Color
backgroundColor
=
Colors
.
red
;
...
...
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