Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class _PractState extends State<EnPract> {
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- backgroundColor: Colors.blueGrey,
- title: Text('Practice Tests'),
- ),
- body: Stack(
- children: <Widget>[
- Container(
- width: 600,
- height: 850,
- child: Image.asset("assets/pencilbg.png",
- fit: BoxFit.fill, alignment: Alignment.center)),
- ListView.builder(
- itemBuilder: (BuildContext context, int index) =>
- EntryItem(data[index]),
- itemCount: data.length,
- )
- ],
- ),
- );
- }
- }
- class EntryItem extends StatelessWidget {
- const EntryItem(this.entry);
- final Entry entry;
- Widget _buildTiles(Entry root) {
- if (root.children.isEmpty) return ListTile(title: Text(root.title), onTap: ,);
- return Card(
- elevation: 1,
- child: ExpansionTile(
- key: PageStorageKey<Entry>(root),
- title: Text(root.title),
- children: root.children.map<Widget>(_buildTiles).toList(),
- ));
- }
- @override
- Widget build(BuildContext context) {
- return _buildTiles(entry);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement