Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HansMuller/c4c3c1f55bc1327b582bd65bbcac19d0 to your computer and use it in GitHub Desktop.
Save HansMuller/c4c3c1f55bc1327b582bd65bbcac19d0 to your computer and use it in GitHub Desktop.
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