-
Notifications
You must be signed in to change notification settings - Fork 100
/
Copy pathlist_page.dart
33 lines (29 loc) · 849 Bytes
/
list_page.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import 'package:flutter/material.dart';
import 'package:flutter_app/ui_utils.dart';
_tile(context, icon, title) => ListTile(
leading: Icon(icon),
title: Text(title),
subtitle: Text('subtitle $title'),
onTap: () => showCustomDialog(context, "Item", title),
);
class _ScaffoldBody extends StatelessWidget {
@override
Widget build(BuildContext context) {
var list = <Widget>[];
for (var i = 0; i < 20; i++) {
list.add(_tile(context, Icons.access_alarm, "Item $i"));
}
return ListView(
children: list,
);
}
}
class ListPage extends StatelessWidget {
static const nav_url = '/list_view';
static const menu_name = 'ListView Page';
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(menu_name)), body: _ScaffoldBody());
}
}