Skip to content

Commit

Permalink
Add missing static functions to AdvancedNavigator
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasAschenbach committed Mar 30, 2021
1 parent f5975da commit b3f0081
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 0.1.1+3
* add static `attach()` and `attachNamed()` functions to `AdvancedNavigator` class

# 0.1.1+2
* Fix: named path '/' not forwarding requests to nested navigators

Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.1.1+2"
version: "0.1.1+3"
async:
dependency: transitive
description:
Expand Down
10 changes: 10 additions & 0 deletions lib/src/advanced_navigator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,16 @@ class AdvancedNavigator extends StatefulWidget {
return AdvancedNavigator.of(context).pushNamed(name, arguments: arguments);
}

@optionalTypeArgs
static Future<T> attach<T extends Object>(BuildContext context, Route<T> route) async {
return AdvancedNavigator.of(context).attach(route);
}

@optionalTypeArgs
static Future<T> attachNamed<T extends Object>(BuildContext context, String name, { Object arguments }) async {
return AdvancedNavigator.of(context).attachNamed(name, arguments: arguments);
}

/// Pop the top-most route off the navigator that most tightly encloses the
/// given context.
///
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: advanced_navigator
description: Flutter's Navigator 2.0 as one easy-to-use widget with full page history manipulation operations, simplified pop event delegation and powerful nesting.
version: 0.1.1+2
version: 0.1.1+3
repository: https://github.com/LucasAschenbach/advanced_navigator

environment:
Expand Down

0 comments on commit b3f0081

Please sign in to comment.