Post detail

This commit is contained in:
2024-11-10 22:56:09 +08:00
parent 49cabd1f39
commit a673beb87c
10 changed files with 150 additions and 13 deletions

View File

@ -171,7 +171,16 @@ class _ExploreScreenState extends State<ExploreScreen> {
hasReachedMax: _postCount != null && _posts.length >= _postCount!,
onFetchData: _fetchPosts,
itemBuilder: (context, idx) {
return PostItem(data: _posts[idx]);
return GestureDetector(
child: PostItem(data: _posts[idx]),
onTap: () {
GoRouter.of(context).pushNamed(
'postDetail',
pathParameters: {'slug': _posts[idx].id.toString()},
extra: _posts[idx],
);
},
);
},
separatorBuilder: (context, index) => const Divider(),
)