Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 50;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -127,7 +127,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
7 changes: 2 additions & 5 deletions lib/posts/posts_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ class PostsPage extends StatelessWidget {
PostTile(
tileColor: posts[i].color,
postTitle: posts[i].title,
onTileTap: () => context.router.push(
SinglePostRoute(
postId: posts[i].id,
),
),
onTileTap: () =>
context.router.pushNamed('/post/${posts[i].id}'),
),
],
),
Expand Down
5 changes: 5 additions & 0 deletions lib/posts/single_post_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:auto_route/annotations.dart';
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bottom_navigation_with_nested_routing_tutorial/data/app_data.dart';

Expand All @@ -13,6 +14,10 @@ class SinglePostPage extends StatelessWidget {
Widget build(BuildContext context) {
final post = Post.posts[postId - 1];
return Scaffold(
appBar: AppBar(
title: Text('Post #${post.id}'),
leading: const AutoBackButton(),
),
backgroundColor: post.color,
body: Center(
child: Padding(
Expand Down
22 changes: 14 additions & 8 deletions lib/routes/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ import 'package:flutter_bottom_navigation_with_nested_routing_tutorial/users/use
path: '',
page: PostsPage,
),
AutoRoute(
path: ':postId',
page: SinglePostPage,
)
],
),
AutoRoute(
Expand All @@ -35,17 +31,27 @@ import 'package:flutter_bottom_navigation_with_nested_routing_tutorial/users/use
page: UsersPage,
),
AutoRoute(
path: ':userId',
page: UserProfilePage,
),
path: ':userId',
name: 'UserRouter',
page: EmptyRouterPage,
children: [
AutoRoute(path: '', page: UserProfilePage),
AutoRoute(
path: 'posts', name: 'UserPostsRoute', page: PostsPage),
]),
],
),
AutoRoute(
path: 'settings',
name: 'SettingsRouter',
page: SettingsPage,
)
),
]),
AutoRoute(
path: '/post',
name: 'PostRouter',
page: EmptyRouterPage,
children: [AutoRoute(path: ':postId', page: SinglePostPage)])
],
)
class $AppRouter {}
Loading