-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathposts_page.dart
More file actions
32 lines (31 loc) · 1.05 KB
/
posts_page.dart
File metadata and controls
32 lines (31 loc) · 1.05 KB
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
import 'package:flutter/material.dart';
import 'package:auto_route/auto_route.dart';
import 'package:flutter_bottom_navigation_with_nested_routing_tutorial/data/app_data.dart';
import 'package:flutter_bottom_navigation_with_nested_routing_tutorial/routes/router.gr.dart';
import 'package:flutter_bottom_navigation_with_nested_routing_tutorial/widgets.dart';
class PostsPage extends StatelessWidget {
PostsPage({Key? key}) : super(key: key);
final posts = Post.posts;
@override
Widget build(BuildContext context) {
return Center(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 20,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
for (int i = 0; i < posts.length; i++)
PostTile(
tileColor: posts[i].color,
postTitle: posts[i].title,
onTileTap: () =>
context.router.pushNamed('/post/${posts[i].id}'),
),
],
),
),
);
}
}