Skip to content

Commit

Permalink
prepare merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Milad-Akarie committed Jul 30, 2024
1 parent a90a0fe commit 01cd3ba
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 6 deletions.
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@ class DashboardPage extends StatelessWidget {
}
}
```

**Note** NavLink is just a button that calls router.push(destination). Now if we navigate to `/dashboard/users`, we will be taken to the `DashboardPage` and the `UsersPage` will be shown inside of it.

What if want to show one of the child pages at `/dashboard`? We can simply do that by giving the child routes an empty path `''` to make initial or by setting initial to true.
Expand All @@ -416,6 +415,36 @@ AutoRoute(
)
```

#### Creating Empty Shell routes
Empty shell routes build a screen that contain the `AutoRouter` widget, which is used to render nested routes.
So you can build the widget your self like follows:
```dart
@RoutePage()
class MyShellPage extends StatelessWidget {
const MyShellPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
/// you can wrap the AutoRouter with any widget you want
return AutoRouter();
}
}
```
You can shorten the code above a bit by directly extending the `AutoRouter` Widget.
```dart
@RoutePage()
class MyShellPage extends AutoRouter {
const MyShellPage({Key? key}) : super(key: key);
}
```

finally you can create a shell route without code generation using the `EmptyShellRoute` helper

```dart
final BooksTab = EmptyShellRoute('BooksTab');
context.push(BooksTab());
```


or by using a `RedirectRoute`

```dart
Expand Down
Binary file added art/auto_route_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions auto_route/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
## 9.0.0 [Breaking Changes]

- **BREAKING CHANGE**: No Router class will be generated anymore. Instead, you
extend `RootStackRouter` from the `auto_route` package.
- **BREAKING CHANGE**: Providing return types inside `@RoutePage<Type>()` is no longer needed. you
just provide the type as you push the page.
- **BREAKING CHANGE**: Providing a global route is now done by overriding the `guards` property
inside the router. implementing AutoRouteGuard is no longer supported.
- **BREAKING CHANGE**: `AutoRouterConfig.module` is removed as it's no longer needed. `PageRouteInfos` are now self-contained.
-
For more info read the complete migration guide
[Migrating to v9](https://github.com/Milad-Akarie/auto_route_library/blob/master/migrations/migrating_to_v9.md)

- **FIX**: Fix Aliased types are not generated correctly.
- **FEAT**: You can now create empty shell routes like follows:
```dart
final BooksTab = EmptyShellRoute('BooksTab');
context.push(BooksTab());
```

## 8.3.0

- **FEAT**: add url#fragment support.
Expand Down
13 changes: 10 additions & 3 deletions auto_route/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
name: auto_route
description: AutoRoute is a declarative routing solution, where everything needed for navigation is automatically generated for you.
version: 8.3.0
version: 9.0.0
homepage: https://github.com/Milad-Akarie/auto_route_library
screenshots:
- description: 'Auto Route Logo'
path: art/auto_route_logo.png
topics:
- Navigation
- Router
- Flutter Routes

environment:
sdk: ">=3.0.0 <4.0.0"
Expand All @@ -11,7 +18,7 @@ dependencies:
flutter:
sdk: flutter
path: ^1.9.0
web: ^0.5.1
web: ^1.0.0
collection: ^1.18.0
meta: ^1.12.0

Expand All @@ -21,7 +28,7 @@ dependencies:
dev_dependencies:
build_runner:
mockito: ^5.4.4
auto_route_generator: ^8.1.0
auto_route_generator: ^9.0.0
flutter_test:
sdk: flutter
flutter_lints: ^4.0.0
Expand Down
21 changes: 21 additions & 0 deletions auto_route_generator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
## 9.0.0 [Breaking Changes]

- **BREAKING CHANGE**: No Router class will be generated anymore. Instead, you
extend `RootStackRouter` from the `auto_route` package.
- **BREAKING CHANGE**: Providing return types inside `@RoutePage<Type>()` is no longer needed. you
just provide the type as you push the page.
- **BREAKING CHANGE**: Providing a global route is now done by overriding the `guards` property
inside the router. implementing AutoRouteGuard is no longer supported.
- **BREAKING CHANGE**: `AutoRouterConfig.module` is removed as it's no longer needed. `PageRouteInfos` are now self-contained.
-
For more info read the complete migration guide
[Migrating to v9](https://github.com/Milad-Akarie/auto_route_library/blob/master/migrations/migrating_to_v9.md)

- **FIX**: Fix Aliased types are not generated correctly.
- **FEAT**: You can now create empty shell routes like follows:
```dart
final BooksTab = EmptyShellRoute('BooksTab');
context.push(BooksTab());
```


## 8.1.0
- **FEAT**: add url#fragment support.
- **CHORE**: update auto_route_generator dependencies
Expand Down
4 changes: 2 additions & 2 deletions auto_route_generator/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: auto_route_generator
description: AutoRoute is a declarative routing solution, where everything needed for navigation is automatically generated for you.
version: 8.1.0
version: 9.0.0
homepage: https://github.com/Milad-Akarie/auto_route_library
environment:
sdk: ">=3.3.0 <4.0.0"
Expand All @@ -19,7 +19,7 @@ dependencies:
args: ^2.5.0
glob: ^2.1.2
package_config: ^2.1.0
auto_route: ^8.3.0
auto_route: ^9.0.0



Expand Down

0 comments on commit 01cd3ba

Please sign in to comment.