Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Milad-Akarie/auto_route_library
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: auto_route-v7.8.3
Choose a base ref
...
head repository: Milad-Akarie/auto_route_library
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: auto_route-v7.8.4
Choose a head ref
  • 15 commits
  • 13 files changed
  • 7 contributors

Commits on Aug 31, 2023

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    93528ad View commit details

Commits on Sep 10, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e9d795f View commit details

Commits on Sep 19, 2023

  1. Merge pull request #1728 from luftmensch-luftmensch/fix-readme-nested…

    …-route-image
    
    Fixed src image for Nested routes
    Milad-Akarie authored Sep 19, 2023
    Copy the full SHA
    dcc8b11 View commit details

Commits on Sep 20, 2023

  1. docs: fix typo

    ictsolved authored Sep 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ac9124d View commit details

Commits on Sep 27, 2023

  1. Add path related to error

    bounty1342 authored Sep 27, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6334a50 View commit details

Commits on Oct 3, 2023

  1. Added copyWith to AuotRoute

    For AutoRoute: renamed _changePath to _change. Added copyWith() Refactored changePath() to use copyWith.
    jonpittock committed Oct 3, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0ff0f6f View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2b206bf View commit details

Commits on Oct 5, 2023

  1. Update stale.yml

    stop stale bot from closing issues and prs
    Milad-Akarie authored Oct 5, 2023
    Copy the full SHA
    78868fa View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    1d5e9b9 View commit details
  3. Merge pull request #1745 from bounty1342/master

    Add path related to error
    Milad-Akarie authored Oct 5, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    c6df5e3 View commit details
  4. Merge pull request #1742 from ictsolved/master

    docs: fix typo
    Milad-Akarie authored Oct 5, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    c7d26db View commit details
  5. Merge pull request #1715 from VSydorko/fix_tab_bar

    fix: ensure dynamic tab updates are handled in AutoTabsRouter.tabBar
    Milad-Akarie authored Oct 5, 2023
    Copy the full SHA
    61f9d28 View commit details
  6. Merge pull request #1751 from re-flow-co-uk/master

    Added copyWith to AutoRoute
    Milad-Akarie authored Oct 5, 2023
    Copy the full SHA
    8b2d889 View commit details
  7. add: AutoRoute.copyWith

    fix: AutoTabView dynamic children issue
    Milad-Akarie committed Oct 5, 2023
    Copy the full SHA
    8c75810 View commit details
  8. chore(release): publish packages

     - auto_route@7.8.4
     - auto_route_generator@7.3.2
    Milad-Akarie committed Oct 5, 2023
    Copy the full SHA
    37b53d4 View commit details
3 changes: 3 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -26,3 +26,6 @@ jobs:
stale-pr-message: 'This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
days-before-stale: 30
days-before-close: -1
days-before-pr-close: -1
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,33 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 2023-10-05

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`auto_route` - `v7.8.4`](#auto_route---v784)
- [`auto_route_generator` - `v7.3.2`](#auto_route_generator---v732)

---

#### `auto_route` - `v7.8.4`

- **FIX**: ensure dynamic tab updates are handled in AutoTabsRouter.tabBar.
- **FIX**: issue related to parsing deep-links after flutter 3.13.0.

#### `auto_route_generator` - `v7.3.2`

- **DOCS**: Add public Api docs to auto_route_generator.


## 2023-08-23

### Changes
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -169,7 +169,7 @@ class AppRouter extends $AppRouter {
after you run the generator your router class will be generated, hook it up with MaterialApp.

```dart
// assuing this is the root widget of your App
// assuming this is the root widget of your App
class App extends StatelessWidget {
// make sure you don't initiate your router
// inside of the build function.
@@ -382,7 +382,7 @@ Nested navigation means building an inner router inside of a page of another rou
the below diagram users page is built inside of dashboard page.

<p align="center">
<img src="https://raw.githubusercontent.com/Milad-Akarie/auto_route_library/dev/art/nested_router_demo.png" height="370">
<img src="https://raw.githubusercontent.com/Milad-Akarie/auto_route_library/master/art/nested_router_demo.png?raw=true" height="370">
</p>

defining nested routes is as easy as populating the children field of the parent route. In the
5 changes: 5 additions & 0 deletions auto_route/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 7.8.4

- **FIX**: ensure dynamic tab updates are handled in AutoTabsRouter.tabBar.
- **FIX**: issue related to parsing deep-links after flutter 3.13.0.

## 7.8.2

- **HOTFIX**: update sdk constrains to flutter: >=3.13.0 and dart: >=3.0.0 <4.0.0
4 changes: 0 additions & 4 deletions auto_route/example/build.yaml
Original file line number Diff line number Diff line change
@@ -9,10 +9,6 @@ targets:
- lib/**_page.dart
- lib/**router.dart
auto_route_generator:auto_router_generator:
options:
ignore_for_file:
- rule-1
- rule-2
# enable_cached_builds: true
generate_for:
- lib/**router.dart
2 changes: 0 additions & 2 deletions auto_route/example/lib/mobile/router/router.gr.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions auto_route/example/lib/web_demo/router/web_router.gr.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

133 changes: 80 additions & 53 deletions auto_route/lib/src/route/auto_route_config.dart
Original file line number Diff line number Diff line change
@@ -91,11 +91,13 @@ class AutoRoute {
this.allowSnapshotting = true,
this.initial = false,
List<AutoRoute>? children,
}) : _path = path,
_children =
children != null ? RouteCollection.fromList(children) : null;
})
: _path = path,
_children = children != null && children.isNotEmpty
? RouteCollection.fromList(children)
: null;

const AutoRoute._changePath({
const AutoRoute._change({
required this.name,
required String path,
required this.usesPathAsKey,
@@ -111,7 +113,8 @@ class AutoRoute {
required RouteCollection? children,
required this.initial,
required this.allowSnapshotting,
}) : _path = path,
})
: _path = path,
_children = children;

/// Builds a default AutoRoute instance with any [type]
@@ -209,23 +212,48 @@ class AutoRoute {
/// A simplified copyWith
///
/// Returns a new AutoRoute instance with the provided path
AutoRoute changePath(String path) {
return AutoRoute._changePath(
name: name,
path: path,
fullMatch: fullMatch,
guards: guards,
usesPathAsKey: usesPathAsKey,
meta: meta,
type: type,
fullscreenDialog: fullscreenDialog,
maintainState: maintainState,
title: title,
keepHistory: keepHistory,
children: children,
restorationId: restorationId,
initial: initial,
allowSnapshotting: allowSnapshotting,
AutoRoute changePath(String path) => copyWith(path: path);

/// A simplified copyWith
///
/// Returns a new AutoRoute instance with the provided details overriding.
AutoRoute copyWith({
RouteType? type,
String? name,
String? path,
bool? usesPathAsKey,
List<AutoRouteGuard>? guards,
bool? fullMatch,
Map<String, dynamic>? meta,
bool? maintainState,
bool? fullscreenDialog,
List<AutoRoute>? children,
TitleBuilder? title,
RestorationIdBuilder? restorationId,
bool? keepHistory,
bool? initial,
bool? allowSnapshotting,
}) {
return AutoRoute._change(
type: type ?? this.type,
name: name ?? this.name,
path: path ?? this.path,
usesPathAsKey: usesPathAsKey ?? this.usesPathAsKey,
guards: guards ?? List.from(this.guards),
//copy
fullMatch: fullMatch ?? this.fullMatch,
meta: meta ?? this.meta,
maintainState: maintainState ?? this.maintainState,
fullscreenDialog: fullscreenDialog ?? this.fullscreenDialog,
children: children != null
? (children.isEmpty ? null : RouteCollection.fromList(children))
: this.children,
//copy
title: title ?? this.title,
restorationId: restorationId ?? this.restorationId,
keepHistory: keepHistory ?? this.keepHistory,
initial: initial ?? this.initial,
allowSnapshotting: allowSnapshotting ?? this.allowSnapshotting,
);
}
}
@@ -245,9 +273,9 @@ class RedirectRoute extends AutoRoute {
required super.path,
required this.redirectTo,
}) : super._(
name: 'Redirect#$path',
fullMatch: true,
);
name: 'Redirect#$path',
fullMatch: true,
);
}

/// Builds an [AutoRoute] instance with [RouteType.material] type
@@ -270,9 +298,9 @@ class MaterialRoute extends AutoRoute {
super.initial,
super.allowSnapshotting = true,
}) : super._(
name: page.name,
type: const RouteType.material(),
);
name: page.name,
type: const RouteType.material(),
);
}

/// Builds an [AutoRoute] instance with [RouteType.cupertino] type
@@ -318,9 +346,9 @@ class AdaptiveRoute extends AutoRoute {
super.keepHistory,
super.allowSnapshotting = true,
}) : super._(
name: page.name,
type: RouteType.adaptive(opaque: opaque),
);
name: page.name,
type: RouteType.adaptive(opaque: opaque),
);
}

/// Builds an [AutoRoute] instance with [RouteType.custom] type
@@ -351,26 +379,25 @@ class CustomRoute extends AutoRoute {
super.restorationId,
Color? barrierColor,
}) : super._(
name: page.name,
type: RouteType.custom(
transitionsBuilder: transitionsBuilder,
customRouteBuilder: customRouteBuilder,
durationInMilliseconds: durationInMilliseconds,
reverseDurationInMilliseconds: reverseDurationInMilliseconds,
opaque: opaque,
barrierDismissible: barrierDismissible,
barrierLabel: barrierLabel,
barrierColor: barrierColor,
),
);
name: page.name,
type: RouteType.custom(
transitionsBuilder: transitionsBuilder,
customRouteBuilder: customRouteBuilder,
durationInMilliseconds: durationInMilliseconds,
reverseDurationInMilliseconds: reverseDurationInMilliseconds,
opaque: opaque,
barrierDismissible: barrierDismissible,
barrierLabel: barrierLabel,
barrierColor: barrierColor,
),
);
}

/// Builds a simplified [AutoRoute] instance for test
@visibleForTesting
class TestRoute extends AutoRoute {
/// Default constructor
TestRoute(
String name, {
TestRoute(String name, {
String? path,
super.children,
super.fullMatch,
@@ -384,8 +411,7 @@ class TestRoute extends AutoRoute {
@internal
class DummyRootRoute extends AutoRoute {
/// Default constructor
DummyRootRoute(
String name, {
DummyRootRoute(String name, {
required String path,
super.children,
super.fullMatch,
@@ -418,7 +444,8 @@ class RouteCollection {
{bool root = false}) {
final routesMarkedInitial = routes.where((e) => e.initial);
throwIf(routesMarkedInitial.length > 1,
'Invalid data\nThere are more than one initial route in this collection\n${routesMarkedInitial.map((e) => e.name)}');
'Invalid data\nThere are more than one initial route in this collection\n${routesMarkedInitial.map((e) =>
e.name)}');

final targetInitialPath = root ? '/' : '';
var routesMap = <String, AutoRoute>{};
@@ -428,11 +455,11 @@ class RouteCollection {
if (r._path != null) {
throwIf(
!root && r.path.startsWith('/'),
'Sub-paths can not start with a "/"',
'Sub-paths can not start with a "/": ${r.path}',
);
throwIf(
root && !r.path.startsWith(RegExp('[/]|[*]')),
'Root-paths must start with a "/" or be a wild-card',
'Root-paths must start with a "/" or be a wild-card: ${r.path}',
);
routeToUse = r;
} else {
@@ -511,9 +538,9 @@ class RouteCollection {
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is RouteCollection &&
runtimeType == other.runtimeType &&
const MapEquality().equals(_routesMap, other._routesMap);
other is RouteCollection &&
runtimeType == other.runtimeType &&
const MapEquality().equals(_routesMap, other._routesMap);

@override
int get hashCode => const MapEquality().hash(_routesMap);
5 changes: 5 additions & 0 deletions auto_route/lib/src/router/widgets/auto_tab_view.dart
Original file line number Diff line number Diff line change
@@ -84,6 +84,11 @@ class AutoTabViewState extends State<AutoTabView> {
void didUpdateWidget(AutoTabView oldWidget) {
super.didUpdateWidget(oldWidget);
if (widget.controller != oldWidget.controller) {
oldWidget.controller.animation
?.removeListener(_handleTabControllerAnimationTick);
_controller.animation?.addListener(_handleTabControllerAnimationTick);
_updateChildren();

_currentIndex = _controller.index;
_pageController.jumpToPage(_currentIndex!);
}
4 changes: 2 additions & 2 deletions auto_route/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: auto_route
description: AutoRoute is a declarative routing solution, where everything needed for navigation is automatically generated for you.
version: 7.8.2
version: 7.8.4
homepage: https://github.com/Milad-Akarie/auto_route_library

environment:
@@ -19,7 +19,7 @@ dependencies:
dev_dependencies:
build_runner:
mockito: ^5.3.2
auto_route_generator: ^7.3.0
auto_route_generator: ^7.3.2
flutter_test:
sdk: flutter
flutter_lints: ^2.0.1
4 changes: 4 additions & 0 deletions auto_route_generator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 7.3.2

- **DOCS**: Add public Api docs to auto_route_generator.

## 7.3.1

- **DOCS**: Add public Api docs to auto_route_generator.
5 changes: 3 additions & 2 deletions auto_route_generator/build.yaml
Original file line number Diff line number Diff line change
@@ -10,16 +10,17 @@ builders:
build_extensions: { ".dart": [".route.json"] }
auto_apply: dependents
build_to: cache

auto_router_generator:
import: "package:auto_route_generator/builder.dart"
builder_factories: ["autoRouterBuilder"]
build_extensions: { ".dart": [".dart.json"] }
build_extensions: { ".dart": [ ".gr.dart" ] }
auto_apply: dependents
build_to: source
auto_router_module_generator:
import: "package:auto_route_generator/builder.dart"
runs_before: ["auto_route_generator:auto_router_generator"]
builder_factories: ["autoRouterModuleBuilder"]
build_extensions: { ".dart": [".dart.json"] }
build_extensions: { ".dart": [ ".gm.dart" ] }
auto_apply: dependents
build_to: source
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: 7.3.1
version: 7.3.2
homepage: https://github.com/Milad-Akarie/auto_route_library
environment:
sdk: ">=2.17.0 <4.0.0"
@@ -16,7 +16,7 @@ dependencies:
xml: ^6.0.1
args: ^2.3.1
glob: ^2.0.1
auto_route: ^7.8.0
auto_route: ^7.8.4

dev_dependencies:
lints: ^2.0.1