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

Is it possible to take control of status bar taps on iOS? #13

Open
mark8044 opened this issue Jun 5, 2022 · 7 comments
Open

Is it possible to take control of status bar taps on iOS? #13

mark8044 opened this issue Jun 5, 2022 · 7 comments

Comments

@mark8044
Copy link

mark8044 commented Jun 5, 2022

Right now there are problems with nested Scaffolds and detecting status bar taps for scroll to top. This would solve that, but the button on the top right is not as fluid appearing on iOS. Is it possible to modify this project to simply take control of the status bar (a transparent space over the status bar?) to mimic native iOS function?

@NamanShergill
Copy link
Owner

That is a bit out of the scope of the library, have you had a look at this?

https://pub.dev/packages/scrolls_to_top

Also, I’m not sure if you were referring to issue #11 here, but I have published a pre release to fix that.

#11 (comment)

@mark8044
Copy link
Author

mark8044 commented Jun 5, 2022

That is a bit out of the scope of the library, have you had a look at this?

https://pub.dev/packages/scrolls_to_top

Also, I’m not sure if you were referring to issue #11 here, but I have published a pre release to fix that.

#11 (comment)

Yes, Ive tried that package but it doesn't work very well unfortunately.

And yes x2, your #11 fix seems to be exactly ideal/perfect for dealing with nested Scaffolds.

That is why I was hoping this package could be adapted so that the button could be alternatively transparent and wider to cover the very top status bar area, thus mimicking native iOS behavior. Would be amazing :)

Thanks

@NamanShergill
Copy link
Owner

Hmm, I’ll have to research a bit on how flutter handles status bar taps, there’s some relevant discussion here: flutter/flutter#85603 (comment)

I would’ve suggested using the promptReplacementBuilder, but I don’t think there’s any way to overlay a widget on the status bar.

If I’m able to think of a way to incorporate it, will work on doing so.

@NamanShergill
Copy link
Owner

Just curious, now that the issue with primaryscrollcontrollers is fixed, why don’t you just use that? PrimaryScrollController has this built in with the status bar taps scrolling it to top, so not passing a scrollcontroller to a scrollview will automatically give you this behaviour.

@mark8044
Copy link
Author

Just curious, now that the issue with primaryscrollcontrollers is fixed, why don’t you just use that? PrimaryScrollController has this built in with the status bar taps scrolling it to top, so not passing a scrollcontroller to a scrollview will automatically give you this behaviour.

PSC only partially fixes the problem. An issue comes up with nested Scaffolds, as people use with Persistent Bottom Navigation, in which case if you have a nested scaffold, the outer container scaffold takes the tap and nothing happens.

Its a much bigger problem that needs to be addressed, but certainly outside the scope of your project :)

@NamanShergill
Copy link
Owner

I will research on this, if it’s something I could figure out on how to incorporate organically, will do so.

@mark8044
Copy link
Author

I will research on this, if it’s something I could figure out on how to incorporate organically, will do so.

No worries, I appreciate the attempt. I was hoping it was something simple like adapting your work to put a transparent container over the top of the screen, but it sounds like its more involved, so no big deal. 👍

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

2 participants