Closed smkhalsa closed 3 years ago
I got this err so at last I tried example existed with fluro package , when I applyedtransitionType: TransitionType.native
and it throw the same err , any update for that ?
I'm getting this on web when going straight to a page that is not the initial route
This was also happening to me when my initialRoute string was anything other than '/'. e.g. '/login'. Changed that and all good. 🤷🏾♂️
same here.
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ The following NoSuchMethodError was thrown building IconTheme(color: Color(0xdd000000)): The method 'dependOnInheritedWidgetOfExactType' was called on null. Receiver: null Tried calling: dependOnInheritedWidgetOfExactType<_InheritedTheme>()
same error, any update?
same error any updates?? I get an error only on flutter for web when I have a parameter in the url
http://url.com/profile/1
I have a good fix for this is an update is not push in the next few days I will publish my own temp package that others can pull from.
here the forked package is. hopefully fluro fixes this soon. https://pub.dev/packages/fluro_fork
Hi @lukef
This has become a blocking issue after updating to Flutter 1.17 and Fluro 1.6.3
@brianschardt 's fork (thanks!) seems to do the trick. Any chance for an official fix?
Thank you
I am using Flutter 1.17.1 and Fluro 1.6.3. In my case, both: transitionType: TransitionType.nativeModal and transitionType: TransitionType.native are preventing navigation from working. The error is output like this: The method 'dependOnInheritedWidgetOfExactType' was called on null.
I ran into this error in Android Emulator, when i was testing the "Breaking Bapp" app:
If you would like to take a look, simply git clone (master branch) and try "flutter run" it. After it loads, click on any of the items in the "Characters" tab or in the "Quotes" tab. Because of this error navigation doesn't work, error is printed in the console instead.
If i comment out transitionType, it works. Any idea when this issue could be fixed?
Best regards, Jim
You can fork it and update it like here https://github.com/theyakka/fluro/pull/166/commits/ca2e1d927f4b68e8824d5d5569925f2a4a6a587f it works fine for me as i need native transition
here the forked package is. hopefully fluro fixes this soon. https://pub.dev/packages/fluro_fork
With this forks works correctly! Thsnk you very much @brianschardt
here the forked package is. hopefully fluro fixes this soon. https://pub.dev/packages/fluro_fork
awesome, thanks heaps.
Thanks for the fork!
Is the Fluro package still maintained? it seems like a pretty big issue with a simple solution available now for ~3 months
Looks like the last commit was around the same time this was opened. Has this project been abandoned?
Please see https://github.com/theyakka/fluro/issues/184 for an update about the current status of fluro
I am not able to reproduce this. If this is still an issue would someone please post an MVCE and I'll be happy to reopen this.
Can somebody using Fluro Fork post on here when they have confirmed the latest build of fluro doesn't have this issue?
@tobytraylor @lukepighetti I was using fluro_fork
and just tried changing to the original fluro
package and am still running into this issue.
My project is open source, and can be reproduced on the v4.1.0+40100003
branch which I just attempted to switch back to the original package, available here: https://github.com/CometTools/LunaSea/tree/v4.1.0%2B40100003
You don't need to add any of the modules/software to see the problem, just open the drawer and attempt to open the settings page. You can view where I initialize the core router in core/router.dart
, the settings router in modules/settings/core/router.dart
and then each individual route definition can be followed through that file, as I define each route inside of each route file itself. I can produce a MVCE if necessary, but it occurs specifically with TransitionType.native
being used. Attempted with a few other transition types, include FadeIn
, material
, and Cupertino
and the problem does not occur, but I want to keep native transitions for now as I have not finished adopting Fluro across the entire application yet.
Also to note, I am also using the latest Flutter stable branch (1.22.2).
The issue is relatively easy to identify, use the generator in your navigator and when it calls matchRoute
on line 282, it passes a null BuildContext to the function (which is expected, since there is no context available).
Then on line 167 within matchRoute
you attempt to access the platform type by calling if (Theme.of(buildContext).platform == TargetPlatform.iOS) {
, which is what throws the error since buildContext
is null.
The fluro_fork
package remedied this by doing a check for a null context: if (buildContext == null || Theme.of(buildContext).platform == TargetPlatform.iOS) {
. This could be considered non-ideal, since buildContext could be null for an Android device and it would still return a CupertinoPageRoute
, and I saw you closed a pull request which checks the platform using the Platform
class which requires dart:io
which would break web support. But it is definitely still an issue, and a relatively big breaking issue at that.
I'm unable to get null
for buildContext
except for when the first route /
is pushed. So if you have seen null
come in at another time I need a way to reproduce it otherwise I cannot provide assistance with this.
I pushed up https://github.com/lukepighetti/fluro/commit/e341fea57c7064f813e57ade807b2910f7cbdb2a but I'm concerned that if you're getting null
values regularly then this will just break all transitions instead of providing relief on the first build which was the intention.
TLDR: I still need an MVCE to be able to provide assistance.
@lukepighetti Here is an MVCE, everything is contained within the main.dart file: https://github.com/JagandeepBrar/fluro-issue-154-MVCE
Let me know if you need anything else on my side.
Also, just cloned and locally referenced the most recent commit in fluro and the error still occurs. These changes are not in the repository, however.
Is there even a need to separate the cases when using TransitionType.native
?
When reading the MaterialPageRoute class documentation, it says:
A modal route that replaces the entire screen with a platform-adaptive transition.
For Android, the entrance transition for the page slides the route upwards and fades it in. The exit transition is the same, but in reverse.
The transition is adaptive to the platform and on iOS, the route slides in from the right and exits in reverse. The route also shifts to the left in parallax when another page enters to cover it. (These directions are flipped in environments with a right-to-left reading direction.)
Maybe this is new since fluro was originally developed, but testing it personally on iOS and Android devices, using TransitionType.material
does in-fact keep the platform-specific transition type.
I have created a PR that simply removes the platform check and always uses MaterialPageRoute
. I tested it on iOS 14.0-14.2 and Android 9-11: https://github.com/lukepighetti/fluro/pull/191
Merged, thank you so much!
I'm getting the following error when calling the
Router.generator
method:It looks like this change may be the source of the bug.
Is there a reason that
null
is passed forBuildContext
here?