flutterings / flutter_redux_navigation Goto Github PK
View Code? Open in Web Editor NEWNavigation Middleware for Flutter's redux library.
License: MIT License
Navigation Middleware for Flutter's redux library.
License: MIT License
Let me preface this by saying I'm very new to Flutter/Dart.
I'm trying to move a user from a login screen to the home screen. Once they're on the home screen I don't want them to go back either by pressing back on the phone or by using the appbar's back button.
In flutter, I found this did the trick:
onPressed: () => Navigator.pushNamedAndRemoveUntil(
context,
'/home',
(Route<dynamic> route) => false,
)
),
But I can't seem to find a replacement in this library. Is there anything I missed? or possibly a workaround? or would this be a whole new feature?
Hi,
first let me thank you for this library its really helpful.
When I run the following code:
store.dispatch(NavigateToAction.replace("/MainPage"));
the MainPage
shown twice(built twice), its occur with the function pushNamedAndRemoveUntil
too.
BUT if i run, in the same place the following code:
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => MainPage()),
(Route<dynamic> route) => false,
);
the MainPage
shown just one time, as I expected.
What can I do?
Thanks,
Barak.
Sorry if this question is a little basic but how would I override the toString
method on an action that I've imported? I have a logger middleware and I want it to show something like
LoggingMiddleware: {Action: NavigateToAction - '/home' ...
instead of
LoggingMiddleware: {Action: Instance of 'NavigateToAction' ...
is this package going to be updated to support redux 4.0.0 version?
Hi,
I'd like to be able to use flutter_redux_navigation with Nested Navigation.
The Navigator class documentation under Nesting Navigators describes this:
https://docs.flutter.io/flutter/widgets/Navigator-class.html
This would help with tabbed navigation where each tab has its own Navigator.
Thank you!
Hi @esarbanis, on the back of #14 please can you do a new release of this package?
Thanks!
Luke
Please upgrade library for redux 5.0.0. Thanks
I've suddenly started getting the following error:
Launching lib/main.dart on Android SDK built for x86 in debug mode...
โ Built build/app/outputs/flutter-apk/app-debug.apk.
W/FlutterActivityAndFragmentDelegate( 2981): A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.
Connecting to VM Service at ws://127.0.0.1:41783/fLHvG1Kl8u4=/ws
E/flutter ( 2981): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Null check operator used on a null value
E/flutter ( 2981): #0 NavigationMiddleware.call
E/flutter ( 2981): #1 Store._createDispatchers.<anonymous closure>
E/flutter ( 2981): #2 LoggingMiddleware.call
E/flutter ( 2981): #3 Store._createDispatchers.<anonymous closure>
E/flutter ( 2981): #4 Store.dispatch
E/flutter ( 2981): #5 AuthMiddleware._handleAuthenticationStatusChanged
E/flutter ( 2981): #6 AuthMiddleware.call
E/flutter ( 2981): #7 Store._createDispatchers.<anonymous closure>
E/flutter ( 2981): #8 NavigationMiddleware.call
E/flutter ( 2981): #9 Store._createDispatchers.<anonymous closure>
E/flutter ( 2981): #10 LoggingMiddleware.call
E/flutter ( 2981): #11 Store._createDispatchers.<anonymous closure>
E/flutter ( 2981): #12 Store.dispatch
E/flutter ( 2981): #13 AuthMiddleware.call.<anonymous closure>
E/flutter ( 2981): #14 FbAuth.authProfile=
E/flutter ( 2981): #15 FbAuth._onAuthStateChanged
E/flutter ( 2981): #16 FbAuth.init.<anonymous closure>
E/flutter ( 2981): #17 _rootRunUnary (dart:async/zone.dart:1436:47)
E/flutter ( 2981): #18 _CustomZone.runUnary (dart:async/zone.dart:1335:19)
E/flutter ( 2981): #19 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
E/flutter ( 2981): #20 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
E/flutter ( 2981): #21 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
E/flutter ( 2981): #22 _SyncBroadcastStreamController._sendData (dart:async/broadcast_stream_controller.dart:378:25)
E/flutter ( 2981): #23 _BroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:244:5)
E/flutter ( 2981): #24 _AsBroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:475:11)
E/flutter ( 2981): #25 _rootRunUnary (dart:async/zone.dart:1436:47)
E/flutter ( 2981): #26 _CustomZone.runUnary (dart:async/zone.dart:1335:19)
E/flutter ( 2981): #27 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
E/flutter ( 2981): #28 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
E/flutter ( 2981): #29 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
E/flutter ( 2981): #30 _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)
E/flutter ( 2981): #31 _MapStream._handleData (dart:async/stream_pipe.dart:218:10)
E/flutter ( 2981): #32 _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:153:13)
E/flutter ( 2981): #33 _rootRunUnary (dart:async/zone.dart:1436:47)
E/flutter ( 2981): #34 _CustomZone.runUnary (dart:async/zone.dart:1335:19)
E/flutter ( 2981): #35 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
E/flutter ( 2981): #36 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
E/flutter ( 2981): #37 _DelayedData.perform (dart:async/stream_impl.dart:591:14)
E/flutter ( 2981): #38 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:706:11)
E/flutter ( 2981): #39 _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:663:7)
E/flutter ( 2981): #40 _rootRun (dart:async/zone.dart:1420:47)
E/flutter ( 2981): #41 _CustomZone.run (dart:async/zone.dart:1328:19)
E/flutter ( 2981): #42 _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
E/flutter ( 2981): #43 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1276:23)
E/flutter ( 2981): #44 _rootRun (dart:async/zone.dart:1428:13)
E/flutter ( 2981): #45 _CustomZone.run (dart:async/zone.dart:1328:19)
E/flutter ( 2981): #46 _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
E/flutter ( 2981): #47 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1276:23)
E/flutter ( 2981): #48 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
E/flutter ( 2981): #49 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
E/flutter ( 2981):
item 4 in the stacktrace relates to this line in my project:
store.dispatch(NavigateToAction.pushNamedAndRemoveUntil(
WelcomeScreen.route, (route) => false));
Any idea why this has started happening?
Thanks
Navigating from widget tap action, etc. is working great, but when I dispatch an action in StoreConnector.onInit
, which is then intercepted by a Middleware that dispatches a navigation action, I get an error that I can't navigate while the widget is being built. How can I overcome this issue?
Is there any way to do something like Navigator.popUntil
now?
May be referred to #6
I have integrated the library and I have added a middleware that captures the NavigateToAction objects and print a console message about the current and previous path for every change. I have found an issue when using the replace and pop actions. As example see this navigation example:
Page 1 (push) Page 2 (replace) Page 3 (pop) Page 1
I expect that on the last transition, the current path is "Page 1" because I replaced "Page 2" with "Page 3" but with current implementation the value is "Page 2".
The problem is that the method "NavigationMiddleware._setState(String currentPath)" always takes the current path in the transition. For replace action the correct value should be the previous path as we are replacing.
Hi,
Is there a way to pass arguments in, when using the push method?
In the Navigator there is the possibility to do this:
https://docs.flutter.io/flutter/widgets/Navigator/pushNamed.html
Currently we're putting items on our store and then picking them up in our model.
Thanks for the help.
Hello,
Since the upgrade in 2.8.0, I have this issue :
flutter_redux_navigation-0.7.0/lib/src/navigation_middleware.dart:35:26: Error: 'NavigationDestination' is imported from both 'package:flutter/src/material/navigation_bar.dart' and 'package:flutter_redux_navigation/src/navigation_destination.dart'. this._setState(NavigationDestination( ^^^^^^^^^^^^^^^^^^^^^
Now, there is a NavigationDestination class in the material lib and yours. Could you update by renaming your own NavigationDestination class ?
Thanks.
As far as I understand, the way to access the navigator state is not through the redux store, but instead from the global NavigatorHolder.
This works fine for the route name, but not for the arguments.
Say that you have this situation:
conversation
route with an id
argument to indicate which chat you are in.conversation
route with a specific id
, and have different side-effects for messages coming to the current conversation as opposed to other conversationsI don't think there's an easy way of doing that right now. If I'm wrong I'd be happy to learn!
Hey, this is one of the few packages my app depends on that doesn't yet support null safety, are you planning to update?
Thanks
Is there a way to return a value from a screen like is demonstrated in https://flutter.dev/docs/cookbook/navigation/returning-data? I know sharing data with the store works, but this also enables the important use case of running some function (like a dispatch to update the state using an async action) whenever a page's back button is pressed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.