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
d961ae85
Commit
d961ae85
authored
Nov 08, 2019
by
Luiz França
Committed by
Shi-Hao Hong
Nov 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding subtitle to ExpansionTile (#43946)
* Adding subtitle to expansion_tile
parent
dd597395
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
expansion_tile.dart
packages/flutter/lib/src/material/expansion_tile.dart
+7
-0
expansion_tile_test.dart
packages/flutter/test/material/expansion_tile_test.dart
+16
-0
No files found.
packages/flutter/lib/src/material/expansion_tile.dart
View file @
d961ae85
...
...
@@ -35,6 +35,7 @@ class ExpansionTile extends StatefulWidget {
Key
key
,
this
.
leading
,
@required
this
.
title
,
this
.
subtitle
,
this
.
backgroundColor
,
this
.
onExpansionChanged
,
this
.
children
=
const
<
Widget
>[],
...
...
@@ -53,6 +54,11 @@ class ExpansionTile extends StatefulWidget {
/// Typically a [Text] widget.
final
Widget
title
;
/// Additional content displayed below the title.
///
/// Typically a [Text] widget.
final
Widget
subtitle
;
/// Called when the tile expands or collapses.
///
/// When the tile starts expanding, this function is called with the value
...
...
@@ -161,6 +167,7 @@ class _ExpansionTileState extends State<ExpansionTile> with SingleTickerProvider
onTap:
_handleTap
,
leading:
widget
.
leading
,
title:
widget
.
title
,
subtitle:
widget
.
subtitle
,
trailing:
widget
.
trailing
??
RotationTransition
(
turns:
_iconTurns
,
child:
const
Icon
(
Icons
.
expand_more
),
...
...
packages/flutter/test/material/expansion_tile_test.dart
View file @
d961ae85
...
...
@@ -215,4 +215,20 @@ void main() {
expect
(
iconColor
(
expandedIconKey
),
_unselectedWidgetColor
);
expect
(
iconColor
(
collapsedIconKey
),
_accentColor
);
});
testWidgets
(
'ExpansionTile subtitle'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
Scaffold
(
body:
ExpansionTile
(
title:
Text
(
'Title'
),
subtitle:
Text
(
'Subtitle'
),
children:
<
Widget
>[
ListTile
(
title:
Text
(
'0'
))],
),
),
),
);
expect
(
find
.
text
(
'Subtitle'
),
findsOneWidget
);
});
}
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