-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathmain.dart
83 lines (80 loc) · 2.48 KB
/
main.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import 'package:example/advanced/advanced_example.dart';
import 'package:example/centralized/centralized_examples.dart';
import 'package:example/simple/simple_example.dart';
import 'package:example/sliver/sliver_example.dart';
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
theme: ThemeData(
dividerTheme: const DividerThemeData(
indent: 16,
space: 0,
),
),
home: const Example(),
),
);
}
class Example extends StatelessWidget {
const Example({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Infinite List'),
),
body: ListView(
children: [
ListTile(
isThreeLine: true,
onTap: () => Navigator.of(context).push(SimpleExample.route()),
title: const Text('Simple Example'),
subtitle: const Text(
'A simple example that uses an Infinite List '
'in a StatefulWidget.',
),
trailing: const Icon(Icons.chevron_right),
),
const Divider(),
ListTile(
isThreeLine: true,
onTap: () => Navigator.of(context).push(
CentralizedExamples.route(),
),
title: const Text('Centralized Example'),
subtitle: const Text(
'An example that uses an Infinite List '
'in a StatefulWidget and centralizes the loading, '
'empty and error states.',
),
trailing: const Icon(Icons.chevron_right),
),
const Divider(),
ListTile(
isThreeLine: true,
onTap: () => Navigator.of(context).push(AdvancedExample.route()),
title: const Text('Advanced Example'),
subtitle: const Text(
'An advanced example that uses an Infinite List '
'in combination with a Cubit from the Bloc package.',
),
trailing: const Icon(Icons.chevron_right),
),
const Divider(),
ListTile(
isThreeLine: true,
onTap: () {
Navigator.of(context).push(SliverExample.route());
},
title: const Text('Sliver Example'),
subtitle: const Text(
'An example in a sliver',
),
trailing: const Icon(Icons.chevron_right),
),
],
),
);
}
}