Giter VIP home page Giter VIP logo

flutter_redux_navigation's People

Contributors

erfa avatar esarbanis avatar hacker1024 avatar leonardo2204 avatar lukevenediger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flutter_redux_navigation's Issues

Replacement for pushNamedAndRemoveUntil

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?

Navigation Called Twice

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.

[Question] How do you override toString?

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'  ...

NavigationMiddleware: Unhandled Exception: Null check operator used on a null value

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

How to dispatch a navigation action during widget build?

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?

Navigator.popUntil

Is there any way to do something like Navigator.popUntil now?

May be referred to #6

Wrong paths using navigation replace.

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.

Trouble with Flutter 2.8.0

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.

Accessing route arguments from NavigatorHolder

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:

  • You have a chat application where there is a conversation route with an id argument to indicate which chat you are in.
  • You receive push notifications in a middleware for incoming messages
  • When a message comes in, you want to check if you are in the conversation route with a specific id, and have different side-effects for messages coming to the current conversation as opposed to other conversations

I don't think there's an easy way of doing that right now. If I'm wrong I'd be happy to learn!

Null safety

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.