Skip to content

Commit b3f0081

Browse files
Add missing static functions to AdvancedNavigator
1 parent f5975da commit b3f0081

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 0.1.1+3
2+
* add static `attach()` and `attachNamed()` functions to `AdvancedNavigator` class
3+
14
# 0.1.1+2
25
* Fix: named path '/' not forwarding requests to nested navigators
36

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
path: ".."
88
relative: true
99
source: path
10-
version: "0.1.1+2"
10+
version: "0.1.1+3"
1111
async:
1212
dependency: transitive
1313
description:

lib/src/advanced_navigator.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,16 @@ class AdvancedNavigator extends StatefulWidget {
320320
return AdvancedNavigator.of(context).pushNamed(name, arguments: arguments);
321321
}
322322

323+
@optionalTypeArgs
324+
static Future<T> attach<T extends Object>(BuildContext context, Route<T> route) async {
325+
return AdvancedNavigator.of(context).attach(route);
326+
}
327+
328+
@optionalTypeArgs
329+
static Future<T> attachNamed<T extends Object>(BuildContext context, String name, { Object arguments }) async {
330+
return AdvancedNavigator.of(context).attachNamed(name, arguments: arguments);
331+
}
332+
323333
/// Pop the top-most route off the navigator that most tightly encloses the
324334
/// given context.
325335
///

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: advanced_navigator
22
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.
3-
version: 0.1.1+2
3+
version: 0.1.1+3
44
repository: https://github.com/LucasAschenbach/advanced_navigator
55

66
environment:

0 commit comments

Comments
 (0)