Created
June 17, 2016 18:42
-
-
Save HansMuller/7d7dd73728164adbfa8388ebfa97a493 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 Container( | |
decoration: new BoxDecoration(backgroundColor: Colors.green[200].withOpacity(0.25)), | |
child: 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')) | |
] | |
) | |
) | |
] | |
) | |
); | |
} | |
} | |
void main() { | |
runApp(new MaterialApp(home: new TwoLevelListDemo())); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment