Commit e48c822c authored by Adam Barth's avatar Adam Barth

[rename fixit] left -> leading, right -> trailing

The terms "left" and "right" have an LTR bias. Instead, we now use
"leading" and "trailing", for these list and grid decorations so that
we can later rearrange them to match the reading order.

Fixes #2540
Fixes #2548
parent 6a2edbbf
...@@ -72,7 +72,7 @@ class GridDemoPhotoItem extends StatelessWidget { ...@@ -72,7 +72,7 @@ class GridDemoPhotoItem extends StatelessWidget {
return new GridTile( return new GridTile(
header: new GridTileBar( header: new GridTileBar(
backgroundColor: Colors.black.withAlpha(0x08), backgroundColor: Colors.black.withAlpha(0x08),
left: new Icon(icon: Icons.info, color: Colors.white70), leading: new Icon(icon: Icons.info, color: Colors.white70),
title: new Text(photo.title) title: new Text(photo.title)
), ),
child: image child: image
...@@ -83,8 +83,8 @@ class GridDemoPhotoItem extends StatelessWidget { ...@@ -83,8 +83,8 @@ class GridDemoPhotoItem extends StatelessWidget {
footer: new GridTileBar( footer: new GridTileBar(
backgroundColor: Colors.black.withAlpha(0x08), backgroundColor: Colors.black.withAlpha(0x08),
title: new Text(photo.title), title: new Text(photo.title),
caption: new Text(photo.caption), subtitle: new Text(photo.caption),
right: new Icon(icon: Icons.info, color: Colors.white70) trailing: new Icon(icon: Icons.info, color: Colors.white70)
), ),
child: image child: image
); );
......
...@@ -99,13 +99,13 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> { ...@@ -99,13 +99,13 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
background: new Container( background: new Container(
decoration: new BoxDecoration(backgroundColor: theme.primaryColor), decoration: new BoxDecoration(backgroundColor: theme.primaryColor),
child: new ListItem( child: new ListItem(
left: new Icon(icon: Icons.delete, color: Colors.white, size: 36.0) leading: new Icon(icon: Icons.delete, color: Colors.white, size: 36.0)
) )
), ),
secondaryBackground: new Container( secondaryBackground: new Container(
decoration: new BoxDecoration(backgroundColor: theme.primaryColor), decoration: new BoxDecoration(backgroundColor: theme.primaryColor),
child: new ListItem( child: new ListItem(
right: new Icon(icon: Icons.archive, color: Colors.white, size: 36.0) trailing: new Icon(icon: Icons.archive, color: Colors.white, size: 36.0)
) )
), ),
child: new Container( child: new Container(
...@@ -114,8 +114,8 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> { ...@@ -114,8 +114,8 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
border: new Border(bottom: new BorderSide(color: theme.dividerColor)) border: new Border(bottom: new BorderSide(color: theme.dividerColor))
), ),
child: new ListItem( child: new ListItem(
primary: new Text(item.name), title: new Text(item.name),
secondary: new Text('${item.subject}\n${item.body}'), subtitle: new Text('${item.subject}\n${item.body}'),
isThreeLine: true isThreeLine: true
) )
) )
......
...@@ -49,8 +49,8 @@ class ListDemoState extends State<ListDemo> { ...@@ -49,8 +49,8 @@ class ListDemoState extends State<ListDemo> {
children: <Widget>[ children: <Widget>[
new ListItem( new ListItem(
dense: true, dense: true,
primary: new Text('One-line'), title: new Text('One-line'),
right: new Radio<ListDemoItemSize>( trailing: new Radio<ListDemoItemSize>(
value: ListDemoItemSize.oneLine, value: ListDemoItemSize.oneLine,
groupValue: _itemSize, groupValue: _itemSize,
onChanged: changeItemSize onChanged: changeItemSize
...@@ -58,8 +58,8 @@ class ListDemoState extends State<ListDemo> { ...@@ -58,8 +58,8 @@ class ListDemoState extends State<ListDemo> {
), ),
new ListItem( new ListItem(
dense: true, dense: true,
primary: new Text('Two-line'), title: new Text('Two-line'),
right: new Radio<ListDemoItemSize>( trailing: new Radio<ListDemoItemSize>(
value: ListDemoItemSize.twoLine, value: ListDemoItemSize.twoLine,
groupValue: _itemSize, groupValue: _itemSize,
onChanged: changeItemSize onChanged: changeItemSize
...@@ -67,8 +67,8 @@ class ListDemoState extends State<ListDemo> { ...@@ -67,8 +67,8 @@ class ListDemoState extends State<ListDemo> {
), ),
new ListItem( new ListItem(
dense: true, dense: true,
primary: new Text('Three-line'), title: new Text('Three-line'),
right: new Radio<ListDemoItemSize>( trailing: new Radio<ListDemoItemSize>(
value: ListDemoItemSize.threeLine, value: ListDemoItemSize.threeLine,
groupValue: _itemSize, groupValue: _itemSize,
onChanged: changeItemSize onChanged: changeItemSize
...@@ -76,8 +76,8 @@ class ListDemoState extends State<ListDemo> { ...@@ -76,8 +76,8 @@ class ListDemoState extends State<ListDemo> {
), ),
new ListItem( new ListItem(
dense: true, dense: true,
primary: new Text('Show Avatar'), title: new Text('Show Avatar'),
right: new Checkbox( trailing: new Checkbox(
value: _showAvatars, value: _showAvatars,
onChanged: (bool value) { onChanged: (bool value) {
setState(() { setState(() {
...@@ -89,8 +89,8 @@ class ListDemoState extends State<ListDemo> { ...@@ -89,8 +89,8 @@ class ListDemoState extends State<ListDemo> {
), ),
new ListItem( new ListItem(
dense: true, dense: true,
primary: new Text('Show Icon'), title: new Text('Show Icon'),
right: new Checkbox( trailing: new Checkbox(
value: _showIcons, value: _showIcons,
onChanged: (bool value) { onChanged: (bool value) {
setState(() { setState(() {
...@@ -102,8 +102,8 @@ class ListDemoState extends State<ListDemo> { ...@@ -102,8 +102,8 @@ class ListDemoState extends State<ListDemo> {
), ),
new ListItem( new ListItem(
dense: true, dense: true,
primary: new Text('Show Dividers'), title: new Text('Show Dividers'),
right: new Checkbox( trailing: new Checkbox(
value: _showDividers, value: _showDividers,
onChanged: (bool value) { onChanged: (bool value) {
setState(() { setState(() {
...@@ -115,8 +115,8 @@ class ListDemoState extends State<ListDemo> { ...@@ -115,8 +115,8 @@ class ListDemoState extends State<ListDemo> {
), ),
new ListItem( new ListItem(
dense: true, dense: true,
primary: new Text('Dense Layout'), title: new Text('Dense Layout'),
right: new Checkbox( trailing: new Checkbox(
value: _dense, value: _dense,
onChanged: (bool value) { onChanged: (bool value) {
setState(() { setState(() {
...@@ -146,10 +146,10 @@ class ListDemoState extends State<ListDemo> { ...@@ -146,10 +146,10 @@ class ListDemoState extends State<ListDemo> {
return new ListItem( return new ListItem(
isThreeLine: _itemSize == ListDemoItemSize.threeLine, isThreeLine: _itemSize == ListDemoItemSize.threeLine,
dense: _dense, dense: _dense,
left: _showAvatars ? new CircleAvatar(child: new Text(item)) : null, leading: _showAvatars ? new CircleAvatar(child: new Text(item)) : null,
primary: new Text('This item represents $item'), title: new Text('This item represents $item'),
secondary: secondary, subtitle: secondary,
right: _showIcons ? new Icon(icon: Icons.info, color: Theme.of(context).disabledColor) : null trailing: _showIcons ? new Icon(icon: Icons.info, color: Theme.of(context).disabledColor) : null
); );
} }
......
...@@ -85,8 +85,8 @@ class MenuDemoState extends State<MenuDemo> { ...@@ -85,8 +85,8 @@ class MenuDemoState extends State<MenuDemo> {
// a simple menu with one disabled item. Typically the contents // a simple menu with one disabled item. Typically the contents
// of this "contextual menu" would reflect the app's state. // of this "contextual menu" would reflect the app's state.
new ListItem( new ListItem(
primary: new Text('An item with a context menu button'), title: new Text('An item with a context menu button'),
right: new PopupMenuButton<String>( trailing: new PopupMenuButton<String>(
onSelected: showMenuSelection, onSelected: showMenuSelection,
items: <PopupMenuItem<String>>[ items: <PopupMenuItem<String>>[
new PopupMenuItem<String>( new PopupMenuItem<String>(
...@@ -108,37 +108,37 @@ class MenuDemoState extends State<MenuDemo> { ...@@ -108,37 +108,37 @@ class MenuDemoState extends State<MenuDemo> {
// a menu whose items have text labels and icons and a divider // a menu whose items have text labels and icons and a divider
// That separates the first three items from the last one. // That separates the first three items from the last one.
new ListItem( new ListItem(
primary: new Text('An item with a sectioned menu'), title: new Text('An item with a sectioned menu'),
right: new PopupMenuButton<String>( trailing: new PopupMenuButton<String>(
onSelected: showMenuSelection, onSelected: showMenuSelection,
items: <PopupMenuEntry<String>>[ items: <PopupMenuEntry<String>>[
new PopupMenuItem<String>( new PopupMenuItem<String>(
value: 'Preview', value: 'Preview',
child: new ListItem( child: new ListItem(
left: new Icon(icon: Icons.visibility), leading: new Icon(icon: Icons.visibility),
primary: new Text('Preview') title: new Text('Preview')
) )
), ),
new PopupMenuItem<String>( new PopupMenuItem<String>(
value: 'Share', value: 'Share',
child: new ListItem( child: new ListItem(
left: new Icon(icon: Icons.person_add), leading: new Icon(icon: Icons.person_add),
primary: new Text('Share') title: new Text('Share')
) )
), ),
new PopupMenuItem<String>( new PopupMenuItem<String>(
value: 'Get Link', value: 'Get Link',
child: new ListItem( child: new ListItem(
left: new Icon(icon: Icons.link), leading: new Icon(icon: Icons.link),
primary: new Text('Get Link') title: new Text('Get Link')
) )
), ),
new PopupMenuDivider(), new PopupMenuDivider(),
new PopupMenuItem<String>( new PopupMenuItem<String>(
value: 'Remove', value: 'Remove',
child: new ListItem( child: new ListItem(
left: new Icon(icon: Icons.delete), leading: new Icon(icon: Icons.delete),
primary: new Text('Remove') title: new Text('Remove')
) )
) )
] ]
...@@ -151,8 +151,8 @@ class MenuDemoState extends State<MenuDemo> { ...@@ -151,8 +151,8 @@ class MenuDemoState extends State<MenuDemo> {
initialValue: _simpleValue, initialValue: _simpleValue,
onSelected: showMenuSelection, onSelected: showMenuSelection,
child: new ListItem( child: new ListItem(
primary: new Text('An item with a simple menu'), title: new Text('An item with a simple menu'),
secondary: new Text(_simpleValue) subtitle: new Text(_simpleValue)
), ),
items: <PopupMenuItem<String>>[ items: <PopupMenuItem<String>>[
new PopupMenuItem<String>( new PopupMenuItem<String>(
...@@ -172,8 +172,8 @@ class MenuDemoState extends State<MenuDemo> { ...@@ -172,8 +172,8 @@ class MenuDemoState extends State<MenuDemo> {
// Pressing the PopupMenuButton on the right of this item shows a menu // Pressing the PopupMenuButton on the right of this item shows a menu
// whose items have checked icons that reflect this app's state. // whose items have checked icons that reflect this app's state.
new ListItem( new ListItem(
primary: new Text('An item with a checklist menu'), title: new Text('An item with a checklist menu'),
right: new PopupMenuButton<String>( trailing: new PopupMenuButton<String>(
onSelected: showCheckedMenuSelections, onSelected: showCheckedMenuSelections,
items: <PopupMenuItem<String>>[ items: <PopupMenuItem<String>>[
new CheckedPopupMenuItem<String>( new CheckedPopupMenuItem<String>(
......
...@@ -13,17 +13,17 @@ class TwoLevelListDemo extends StatelessWidget { ...@@ -13,17 +13,17 @@ class TwoLevelListDemo extends StatelessWidget {
child: new TwoLevelList( child: new TwoLevelList(
type: MaterialListType.oneLine, type: MaterialListType.oneLine,
items: <Widget>[ items: <Widget>[
new TwoLevelListItem(center: new Text('Top')), new TwoLevelListItem(title: new Text('Top')),
new TwoLevelSublist( new TwoLevelSublist(
center: new Text('Sublist'), center: new Text('Sublist'),
children: <Widget>[ children: <Widget>[
new TwoLevelListItem(center: new Text('One')), new TwoLevelListItem(title: new Text('One')),
new TwoLevelListItem(center: new Text('Two')), new TwoLevelListItem(title: new Text('Two')),
new TwoLevelListItem(center: new Text('Free')), new TwoLevelListItem(title: new Text('Free')),
new TwoLevelListItem(center: new Text('Four')) new TwoLevelListItem(title: new Text('Four'))
] ]
), ),
new TwoLevelListItem(center: new Text('Bottom')) new TwoLevelListItem(title: new Text('Bottom'))
] ]
) )
) )
......
...@@ -49,7 +49,7 @@ class GallerySection extends StatelessWidget { ...@@ -49,7 +49,7 @@ class GallerySection extends StatelessWidget {
type: MaterialListType.oneLine, type: MaterialListType.oneLine,
children: (demos ?? const <GalleryDemo>[]).map((GalleryDemo demo) { children: (demos ?? const <GalleryDemo>[]).map((GalleryDemo demo) {
return new ListItem( return new ListItem(
primary: new Text(demo.title), title: new Text(demo.title),
onTap: () { showDemo(demo, context, theme); } onTap: () { showDemo(demo, context, theme); }
); );
}) })
......
...@@ -13,16 +13,23 @@ import 'typography.dart'; ...@@ -13,16 +13,23 @@ import 'typography.dart';
/// Typically used to stack a one or two line header or footer on a Grid tile. /// Typically used to stack a one or two line header or footer on a Grid tile.
/// The layout is based on the "Grid Lists" section of the Material Design spec: /// The layout is based on the "Grid Lists" section of the Material Design spec:
/// https://www.google.com/design/spec/components/grid-lists.html#grid-lists-specs /// https://www.google.com/design/spec/components/grid-lists.html#grid-lists-specs
/// For a one-line header specify title and to add a second line specify caption. /// For a one-line header specify [title] and to add a second line specify [subtitle].
/// Use left or right to add an icon. /// Use [leading] or [trailing] to add an icon.
class GridTileBar extends StatelessWidget { class GridTileBar extends StatelessWidget {
GridTileBar({ Key key, this.backgroundColor, this.left, this.right, this.title, this.caption }) : super(key: key); GridTileBar({
Key key,
this.backgroundColor,
this.leading,
this.title,
this.subtitle,
this.trailing
}) : super(key: key);
final Color backgroundColor; final Color backgroundColor;
final Widget left; final Widget leading;
final Widget right;
final Widget title; final Widget title;
final Widget caption; final Widget subtitle;
final Widget trailing;
Widget build(BuildContext context) { Widget build(BuildContext context) {
BoxDecoration decoration; BoxDecoration decoration;
...@@ -30,19 +37,19 @@ class GridTileBar extends StatelessWidget { ...@@ -30,19 +37,19 @@ class GridTileBar extends StatelessWidget {
decoration = new BoxDecoration(backgroundColor: backgroundColor); decoration = new BoxDecoration(backgroundColor: backgroundColor);
EdgeInsets padding; EdgeInsets padding;
if (left != null && right != null) if (leading != null && trailing != null)
padding = const EdgeInsets.symmetric(vertical: 16.0, horizontal: 8.0); padding = const EdgeInsets.symmetric(vertical: 16.0, horizontal: 8.0);
else if (left != null) else if (leading != null)
padding = const EdgeInsets.only(left: 8.0, right: 16.0, top: 16.0, bottom: 16.0); padding = const EdgeInsets.only(left: 8.0, right: 16.0, top: 16.0, bottom: 16.0);
else // right != null || (left == null && right == null) else // trailing != null || (leading == null && trailing == null)
padding = const EdgeInsets.only(left: 16.0, right: 8.0, top: 16.0, bottom: 16.0); padding = const EdgeInsets.only(left: 16.0, right: 8.0, top: 16.0, bottom: 16.0);
final List<Widget> children = <Widget>[]; final List<Widget> children = <Widget>[];
if (left != null) if (leading != null)
children.add(new Padding(padding: const EdgeInsets.only(right: 8.0), child: left)); children.add(new Padding(padding: const EdgeInsets.only(right: 8.0), child: leading));
if (title != null && caption != null) { if (title != null && subtitle != null) {
children.add( children.add(
new Flexible( new Flexible(
child: new Column( child: new Column(
...@@ -54,25 +61,25 @@ class GridTileBar extends StatelessWidget { ...@@ -54,25 +61,25 @@ class GridTileBar extends StatelessWidget {
), ),
new DefaultTextStyle( new DefaultTextStyle(
style: Typography.white.caption, style: Typography.white.caption,
child: caption child: subtitle
) )
] ]
) )
) )
); );
} else if (title != null || caption != null) { } else if (title != null || subtitle != null) {
children.add( children.add(
new Flexible( new Flexible(
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: Typography.white.subhead, style: Typography.white.subhead,
child: title ?? caption child: title ?? subtitle
) )
) )
); );
} }
if (right != null) if (trailing != null)
children.add(new Padding(padding: const EdgeInsets.only(left: 8.0), child: right)); children.add(new Padding(padding: const EdgeInsets.only(left: 8.0), child: trailing));
return new Container( return new Container(
padding: padding, padding: padding,
......
...@@ -9,32 +9,32 @@ import 'ink_well.dart'; ...@@ -9,32 +9,32 @@ import 'ink_well.dart';
import 'theme.dart'; import 'theme.dart';
/// Material List items are one to three lines of text optionally flanked by icons. /// Material List items are one to three lines of text optionally flanked by icons.
/// Icons are defined with the [left] and [right] parameters. The first line of text /// Icons are defined with the [leading] and [trailing] parameters. The first line of text
/// is not optional and is specified with [primary]. The value of [secondary] will /// is not optional and is specified with [title]. The value of [subtitle] will
/// occupy the space allocated for an aditional line of text, or two lines if /// occupy the space allocated for an aditional line of text, or two lines if
/// isThreeLine: true is specified. If dense: true is specified then the overall /// isThreeLine: true is specified. If dense: true is specified then the overall
/// height of this list item and the size of the DefaultTextStyles that wrap /// height of this list item and the size of the DefaultTextStyles that wrap
/// the [primary] and [secondary] widget are reduced. /// the [title] and [subtitle] widget are reduced.
class ListItem extends StatelessWidget { class ListItem extends StatelessWidget {
ListItem({ ListItem({
Key key, Key key,
this.left, this.leading,
this.primary, this.title,
this.secondary, this.subtitle,
this.right, this.trailing,
this.isThreeLine: false, this.isThreeLine: false,
this.dense: false, this.dense: false,
this.enabled: true, this.enabled: true,
this.onTap, this.onTap,
this.onLongPress this.onLongPress
}) : super(key: key) { }) : super(key: key) {
assert(isThreeLine ? secondary != null : true); assert(isThreeLine ? subtitle != null : true);
} }
final Widget left; final Widget leading;
final Widget primary; final Widget title;
final Widget secondary; final Widget subtitle;
final Widget right; final Widget trailing;
final bool isThreeLine; final bool isThreeLine;
final bool dense; final bool dense;
final bool enabled; final bool enabled;
...@@ -86,7 +86,7 @@ class ListItem extends StatelessWidget { ...@@ -86,7 +86,7 @@ class ListItem extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
assert(debugCheckHasMaterial(context)); assert(debugCheckHasMaterial(context));
final bool isTwoLine = !isThreeLine && secondary != null; final bool isTwoLine = !isThreeLine && subtitle != null;
final bool isOneLine = !isThreeLine && !isTwoLine; final bool isOneLine = !isThreeLine && !isTwoLine;
double itemHeight; double itemHeight;
if (isOneLine) if (isOneLine)
...@@ -103,20 +103,20 @@ class ListItem extends StatelessWidget { ...@@ -103,20 +103,20 @@ class ListItem extends StatelessWidget {
// Overall, the list item is a Row() with these children. // Overall, the list item is a Row() with these children.
final List<Widget> children = <Widget>[]; final List<Widget> children = <Widget>[];
if (left != null) { if (leading != null) {
children.add(new Container( children.add(new Container(
margin: new EdgeInsets.only(right: 16.0, top: iconMarginTop), margin: new EdgeInsets.only(right: 16.0, top: iconMarginTop),
width: 40.0, width: 40.0,
child: new Align( child: new Align(
alignment: new FractionalOffset(0.0, isThreeLine ? 0.0 : 0.5), alignment: new FractionalOffset(0.0, isThreeLine ? 0.0 : 0.5),
child: left child: leading
) )
)); ));
} }
final Widget primaryLine = new DefaultTextStyle( final Widget primaryLine = new DefaultTextStyle(
style: primaryTextStyle(context), style: primaryTextStyle(context),
child: primary ?? new Container() child: title ?? new Container()
); );
Widget center = primaryLine; Widget center = primaryLine;
if (isTwoLine || isThreeLine) { if (isTwoLine || isThreeLine) {
...@@ -127,7 +127,7 @@ class ListItem extends StatelessWidget { ...@@ -127,7 +127,7 @@ class ListItem extends StatelessWidget {
primaryLine, primaryLine,
new DefaultTextStyle( new DefaultTextStyle(
style: secondaryTextStyle(context), style: secondaryTextStyle(context),
child: secondary child: subtitle
) )
] ]
); );
...@@ -136,12 +136,12 @@ class ListItem extends StatelessWidget { ...@@ -136,12 +136,12 @@ class ListItem extends StatelessWidget {
child: center child: center
)); ));
if (right != null) { if (trailing != null) {
children.add(new Container( children.add(new Container(
margin: new EdgeInsets.only(left: 16.0, top: iconMarginTop), margin: new EdgeInsets.only(left: 16.0, top: iconMarginTop),
child: new Align( child: new Align(
alignment: new FractionalOffset(1.0, isThreeLine ? 0.0 : 0.5), alignment: new FractionalOffset(1.0, isThreeLine ? 0.0 : 0.5),
child: right child: trailing
) )
)); ));
} }
......
...@@ -150,11 +150,11 @@ class _CheckedPopupMenuItemState<T> extends _PopupMenuItemState<CheckedPopupMenu ...@@ -150,11 +150,11 @@ class _CheckedPopupMenuItemState<T> extends _PopupMenuItemState<CheckedPopupMenu
Widget buildChild() { Widget buildChild() {
return new ListItem( return new ListItem(
enabled: config.enabled, enabled: config.enabled,
left: new FadeTransition( leading: new FadeTransition(
opacity: _opacity, opacity: _opacity,
child: new Icon(icon: _controller.isDismissed ? null : Icons.done) child: new Icon(icon: _controller.isDismissed ? null : Icons.done)
), ),
primary: config.child title: config.child
); );
} }
} }
......
...@@ -17,18 +17,18 @@ const Duration _kExpand = const Duration(milliseconds: 200); ...@@ -17,18 +17,18 @@ const Duration _kExpand = const Duration(milliseconds: 200);
class TwoLevelListItem extends StatelessWidget { class TwoLevelListItem extends StatelessWidget {
TwoLevelListItem({ TwoLevelListItem({
Key key, Key key,
this.left, this.leading,
this.center, this.title,
this.right, this.trailing,
this.onTap, this.onTap,
this.onLongPress this.onLongPress
}) : super(key: key) { }) : super(key: key) {
assert(center != null); assert(title != null);
} }
final Widget left; final Widget leading;
final Widget center; final Widget title;
final Widget right; final Widget trailing;
final GestureTapCallback onTap; final GestureTapCallback onTap;
final GestureLongPressCallback onLongPress; final GestureLongPressCallback onLongPress;
...@@ -39,9 +39,9 @@ class TwoLevelListItem extends StatelessWidget { ...@@ -39,9 +39,9 @@ class TwoLevelListItem extends StatelessWidget {
return new SizedBox( return new SizedBox(
height: kListItemExtent[parentList.type], height: kListItemExtent[parentList.type],
child: new ListItem( child: new ListItem(
left: left, leading: leading,
primary: center, title: title,
right: right, trailing: trailing,
onTap: onTap, onTap: onTap,
onLongPress: onLongPress onLongPress: onLongPress
) )
...@@ -108,12 +108,12 @@ class _TwoLevelSublistState extends State<TwoLevelSublist> { ...@@ -108,12 +108,12 @@ class _TwoLevelSublistState extends State<TwoLevelSublist> {
children: <Widget>[ children: <Widget>[
new TwoLevelListItem( new TwoLevelListItem(
onTap: _handleOnTap, onTap: _handleOnTap,
left: config.left, leading: config.left,
center: new DefaultTextStyle( title: new DefaultTextStyle(
style: Theme.of(context).textTheme.subhead.copyWith(color: _headerColor.evaluate(_easeInAnimation)), style: Theme.of(context).textTheme.subhead.copyWith(color: _headerColor.evaluate(_easeInAnimation)),
child: config.center child: config.center
), ),
right: new RotationTransition( trailing: new RotationTransition(
turns: _iconTurns, turns: _iconTurns,
child: new Icon( child: new Icon(
icon: Icons.expand_more, icon: Icons.expand_more,
......
...@@ -19,16 +19,16 @@ void main() { ...@@ -19,16 +19,16 @@ void main() {
child: new Viewport( child: new Viewport(
child: new TwoLevelList( child: new TwoLevelList(
items: <Widget>[ items: <Widget>[
new TwoLevelListItem(center: new Text('Top'), key: topKey), new TwoLevelListItem(title: new Text('Top'), key: topKey),
new TwoLevelSublist( new TwoLevelSublist(
key: sublistKey, key: sublistKey,
center: new Text('Sublist'), center: new Text('Sublist'),
children: <Widget>[ children: <Widget>[
new TwoLevelListItem(center: new Text('0')), new TwoLevelListItem(title: new Text('0')),
new TwoLevelListItem(center: new Text('1')) new TwoLevelListItem(title: new Text('1'))
] ]
), ),
new TwoLevelListItem(center: new Text('Bottom'), key: bottomKey) new TwoLevelListItem(title: new Text('Bottom'), key: bottomKey)
] ]
) )
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment