Created
June 17, 2016 16:39
-
-
Save HansMuller/c4c3c1f55bc1327b582bd65bbcac19d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class TwoLevelListDemo extends StatelessWidget { | |
static const String routeName = '/two-level-list'; | |
@override | |
Widget build(BuildContext context) { | |
return new Scaffold( | |
appBar: new AppBar(title: new Text('Expand/collapse list control')), | |
body: new Column( | |
children: <Widget>[ | |
new Container( | |
height: 56.0, | |
child: new Material( | |
elevation: 4, | |
type: MaterialType.canvas, | |
child: new Padding( | |
padding: const EdgeInsets.symmetric(horizontal: 24.0), | |
child: new Row( | |
mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
children: <Widget>[ | |
new Text('foo'), | |
new Text('bar') | |
] | |
) | |
) | |
) | |
), | |
new TwoLevelList( | |
type: MaterialListType.oneLine, | |
children: <Widget>[ | |
new TwoLevelListItem(title: new Text('Top')), | |
new TwoLevelSublist( | |
title: new Text('Sublist'), | |
children: <Widget>[ | |
new TwoLevelListItem(title: new Text('One')), | |
new TwoLevelListItem(title: new Text('Two')), | |
new TwoLevelListItem(title: new Text('Free')), | |
new TwoLevelListItem(title: new Text('Four')) | |
] | |
), | |
new TwoLevelListItem(title: new Text('Bottom')) | |
] | |
) | |
] | |
) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment