Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CupertinoTabScaffold multiple pages #45

Closed
benoitjadinon opened this issue Apr 25, 2019 · 7 comments
Closed

CupertinoTabScaffold multiple pages #45

benoitjadinon opened this issue Apr 25, 2019 · 7 comments

Comments

@benoitjadinon
Copy link

Whenever you set a bottomNavBar on ios, the CupertinoPageScaffold creates a CupertinoTabScaffold, but its tabBuilder recreates a new CupertinoPageScaffold on each tab click without using the index argument, so it just basically duplicates the body, making the nav bar useless.
Any idea on how to handle ios navigation ? a callback inside CupertinoPageScaffoldData ?
thanks

@aqwert
Copy link
Collaborator

aqwert commented Apr 27, 2019

I will need to look into this a little more. Hopefully in the next few days.

in the meantime could you provide sample code of how you are using it?

@aqwert
Copy link
Collaborator

aqwert commented Apr 28, 2019

I found the issue you are experiencing. Will be getting a fix out soon

@benoitjadinon
Copy link
Author

benoitjadinon commented Apr 28, 2019

ok it's when using a body with a GlobalKey, I get a "Multiple widgets used with the same GlobalKey" error, the current body of the platformscaffold is also used as a CupertinoPageScaffold child (Widget child = body ?? data?.body;) for the newly created CupertinoPageScaffold after a click on a tab, so they maybe both exist at the same time (even for a millisecond before the new body is recalculated), creating this error, that's why the second page also showed the body of the first tab (default body)

I probably shouldn't have used a GlobalKey there (because I had a scaffold as the body of an other one, to get an inside drawer),
about having the scaffold body as base for the other tab pages, at first I thought it was weird, but thinking of it, it's pretty clever ;-)
there may be no simpler way to deal with it, because of the need for a CupertinoPageScaffold wrap, so ok

thanks

@benoitjadinon
Copy link
Author

have you experienced the same issue ? what would the fix be ?

@nuzelac
Copy link

nuzelac commented Sep 25, 2019

I think I am experiencing the same issue:

iPhone 11 Pro Max — 13 0 2019-09-25 19-38-00

@aqwert
Copy link
Collaborator

aqwert commented Oct 3, 2020

Can you post sample code that displays this issue

@deakjahn
Copy link

deakjahn commented Oct 24, 2020

It's basically completely wrong, yes. One workaround could be to make sure you pass a PageView in this case as the body of your scaffold and modify the code to extract the page in question (in createIosWidget()):

child: iosContentPad(context, (body as PageView).childrenDelegate.build(context, index), navigationBar, tabBar),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants