You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Integration with Navigation UI Packages](#integration-with-navigation-ui-packages)
33
35
-[Usage](#usage)
34
-
-[With *App.router](#with-app.router)
35
-
-[As a Widget (WIP)](#as-a-widget-(wip))
36
+
-[On Entire App](#on-entire-app)
37
+
-[As a Widget](#as-a-widget)
36
38
-[General Notes](#general-notes)
37
39
-[Migrating from 0.4.x to >=0.5.x](#migrating-from-0.4.x-to->=0.5.x)
38
40
-[Contributing](#contributing)
@@ -72,39 +74,163 @@ Using Beamer _can_ feel like using many of `Navigator`'s `push/pop` methods at o
72
74
Here is a recreation of books example from [this article](https://medium.com/flutter/learning-flutters-new-navigation-and-routing-system-7c9068155ade) where you can learn a lot about Navigator 2.0. See [Example](https://pub.dev/packages/beamer/example) for full application code of this example.
For a step further, we add more flows to demonstrate the power of Beamer. The full code is available [here](https://github.com/slovnicki/beamer/tree/master/examples/advanced_books).
You can instantly beam to a location in your app that has many pages stacked (deep linking) and then pop them one by one or simply `beamBack` to where you came from. The full code is available [here](https://github.com/slovnicki/beamer/tree/master/examples/deep_location).
88
+
You can instantly beam to a location in your app that has many pages stacked (deep linking) and then pop them one by one or simply `beamBack` to where you came from. The full code is available [here](https://github.com/slovnicki/beamer/tree/master/examples/deep_location). Note that `beamBackOnPop` parameter of `beamTo` might be useful here to override `AppBar`'s `pop` with `beamBack`.
You can override `BeamLocation.builder` to provide some data to the entire location, i.e. to all of the `pages`. The full code is available [here](https://github.com/slovnicki/beamer/tree/master/examples/location_builder).
You can define global guards (for example, authentication guard) or location guards that keep a specific location safe. The full code is available [here](https://github.com/slovnicki/beamer/tree/master/examples/guards).
An example of putting `Beamer` into widget tree. **This is not yet fully functional for web usage**; setting the URL from browser doesn't update the state properly. It should work when [nested routers issue](https://github.com/slovnicki/beamer/issues/4) is done. The full code is available [here](https://github.com/slovnicki/beamer/tree/master/examples/bottom_navigation).
155
+
## Beamer Widget
156
+
157
+
An example of putting `Beamer`(s) into the Widget tree. _This is not yet fully functional for web usage_; setting the URL from browser doesn't update the state properly. It should work when [nested routers issue](https://github.com/slovnicki/beamer/issues/4) is settled.
-[Bottom navigation example with multiple Beamers](https://github.com/slovnicki/beamer/tree/master/examples/bottom_navigation_multiple_beamers)
In order to use Beamer on your entire app, you must (as per [official documentation](https://api.flutter.dev/flutter/widgets/Router-class.html)) construct your `*App` widget with `.router` constructor to which (along with all your regular `*App` attributes) you provide
110
236
@@ -133,53 +259,23 @@ class MyApp extends StatelessWidget {
@@ -188,8 +284,8 @@ class _MyAppState extends State<MyApp> {
188
284
189
285
## General Notes
190
286
191
-
- When extending `BeamLocation`, two getters need to be implemented; `pathBlueprints` and `pages`.
192
-
-`pages` represent a stack that will be built by `Navigator` when you beam there, and `pathBlueprints` is there for Beamer to decide which `BeamLocation` corresponds to an URL coming from browser.
287
+
- When extending `BeamLocation`, two methods need to be implemented; `pathBlueprints` and `pagesBuilder`.
288
+
-`pagesBuilder` returns a stack of pages that will be built by `Navigator` when you beam there, and `pathBlueprints` is there for Beamer to decide which `BeamLocation` corresponds to an URL coming from browser.
193
289
-`BeamLocation` takes query and path parameters from URI. The `:` is necessary in `pathBlueprints` if you _might_ get path parameter from browser.
194
290
195
291
-`BeamPage`'s child is an arbitrary `Widgets` that represent your app screen / page.
0 commit comments