mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[rename fixit] TwoLevelSublist left->leading, center->title
This commit is contained in:
parent
9bc4deed1a
commit
89987fc040
@ -15,7 +15,7 @@ class TwoLevelListDemo extends StatelessWidget {
|
||||
items: <Widget>[
|
||||
new TwoLevelListItem(title: new Text('Top')),
|
||||
new TwoLevelSublist(
|
||||
center: new Text('Sublist'),
|
||||
title: new Text('Sublist'),
|
||||
children: <Widget>[
|
||||
new TwoLevelListItem(title: new Text('One')),
|
||||
new TwoLevelListItem(title: new Text('Two')),
|
||||
|
||||
@ -50,10 +50,10 @@ class TwoLevelListItem extends StatelessWidget {
|
||||
}
|
||||
|
||||
class TwoLevelSublist extends StatefulWidget {
|
||||
TwoLevelSublist({ Key key, this.left, this.center, this.children }) : super(key: key);
|
||||
TwoLevelSublist({ Key key, this.leading, this.title, this.children }) : super(key: key);
|
||||
|
||||
final Widget left;
|
||||
final Widget center;
|
||||
final Widget leading;
|
||||
final Widget title;
|
||||
final List<Widget> children;
|
||||
|
||||
_TwoLevelSublistState createState() => new _TwoLevelSublistState();
|
||||
@ -108,10 +108,10 @@ class _TwoLevelSublistState extends State<TwoLevelSublist> {
|
||||
children: <Widget>[
|
||||
new TwoLevelListItem(
|
||||
onTap: _handleOnTap,
|
||||
leading: config.left,
|
||||
leading: config.leading,
|
||||
title: new DefaultTextStyle(
|
||||
style: Theme.of(context).textTheme.subhead.copyWith(color: _headerColor.evaluate(_easeInAnimation)),
|
||||
child: config.center
|
||||
child: config.title
|
||||
),
|
||||
trailing: new RotationTransition(
|
||||
turns: _iconTurns,
|
||||
|
||||
@ -22,7 +22,7 @@ void main() {
|
||||
new TwoLevelListItem(title: new Text('Top'), key: topKey),
|
||||
new TwoLevelSublist(
|
||||
key: sublistKey,
|
||||
center: new Text('Sublist'),
|
||||
title: new Text('Sublist'),
|
||||
children: <Widget>[
|
||||
new TwoLevelListItem(title: new Text('0')),
|
||||
new TwoLevelListItem(title: new Text('1'))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user