hidable
hidable copied to clipboard
can't unhide hidden widgets
In my app, I have a simple listview and an appbar. After adding just enough items to the listview to overfill the screen, then scroll down to hide the appbar, with the listview now fully revealed, I am unable to bring up the appbar any more. In order to unhide the appbar, I need to add more items to the listview, so that I can scroll down further, then scroll up to unhide the appbar.
Appreciate if anyone can advice on how to bring back the appbar in this situation. Thanks.
You can find the simple app on the following github repo. Just click on the FAB to add more items to listview.
https://github.com/tksoh/flutter_hidable_demo
Tested on Android 11 and Windows 11.
Hello! First of all thanks for your contribution!
This is definitely a bug, so I mean I don't think there is an optimal solution for that right now, one of the closest action to soliton is expanding listview's scroll capacity. i.e hidable will be able to unhide itself via a movable screen.
I'll be looking forward to implementing an optimal solution to the package, thanks again!
@tksoh Btw, you're welcome to contribute, feel free to join our community server and discuss more about implementation.
@theiskaa Thanks for the invitation. Unfortunately right now I'm able to join the discussion due to other commitments. Looking forward to that in the future.
As I understand, the scrollable widget causes this error, not hidable itself. So, I mean, when you hide your static located widget(AppBar, BottomNavigationBar, FAB, or whatever) and you don't have enough items to provide scrolling functionality on your scrollable widget. Hidable keeps being hidden, cause you don't have enough space to scroll to trigger the hidable.
Example:
https://user-images.githubusercontent.com/59066341/215540076-e6124e35-f4cc-4c1a-8e3a-40261090e545.mov
@tksoh "For now" there is no possible solution for that issue that could be implemented to hidable.
As I mentioned above, this issue could be "masked"(not resolved) by adding a artificial scrolling(extra) space to main list page.
@theiskaa I took a different approach in implementing the hiding support for my project, and so far it seems to work for what I needed. Perhaps I can spend some time later to see if your implementation might benefit from that too.
In any case, thanks for looking into this.
I would appreciate it if you share your implementation with us. Maybe it can be an inspiration to implement a whole new different approach to a solution to package.
Thanks for your time :v:
At this point, my implementation is still very much just cater for what I need, and from what I learned so far, I suspect it won't be fit for general use (as a plugin). In case you are interested, I make use of ScrollNotification, instead of ScrollController, to read the scrolling activities. In my previous quick trial, these two don't seem to work well with each other.
FYI, I'm only a few months into Flutter, so clearly you would know more about the topic.
@theiskaa Just FYI, I found a temp workaround for this using OverscrollIndicatorNotification in this commit (https://github.com/tksoh/flutter_hidable_demo/commit/20449526d79fb127ee78971f1ca165a765e101b1). Let me know if you see any issue. Otherwise, perhaps you can see how it might be integrated into your plugin, and that would be great.
Frankly, I still don't get what the 'leading' property is trying to tell us (the doc says it is the meant for 'Whether the indication will be shown on the leading edge of the scroll view'), but it seems to serve the purpose somehow. I will not be surprise the workaround will break in some situations.
Another 'better' attempt, using ScrollNotification this time, in this commit (https://github.com/tksoh/flutter_hidable_demo/commit/a66687593ff70268f043c0a7dd1be30dcefff038).
Flutter is fun ^.^
Oh, I see, the implementation looks fine, we could overwrite the current functionality. But the issue of not having enough space to scroll to hide the static located widget still reamins:
https://user-images.githubusercontent.com/59066341/217232617-972b8413-f0f1-4458-bde9-df0b127b73fd.mov
There appears to be some intermittent issue with scrolling down to unhide. On my phone (Android 11), sometimes it fails to unhide the appbar. I will look more into this.
But the issue of not having enough space to scroll to hide the static located widget still reamins.
I guess I'm slightly confused by this. Can you please help elaborate?
There appears to be some intermittent issue with scrolling down to unhide. On my phone (Android 11), sometimes it fails to unhide the appbar. I will look more into this.
Yes exactly, I tested on various devices (including macos and web) there is the same issue on each device.
But the issue of not having enough space to scroll to hide the static-located widget still remains.
I guess I'm slightly confused by this. Can you please help elaborate?
Oh my bad.
I'm trying to say that, using ScrollNotification
simplifies the problem but the "actual" issue still remains.
As I understand, (and mentioned before) Hidable has a problem with handling scrolling page size (the space on the page that could be scrolled), i.e when we scroll down and hide the "Hidable" widget, that scrollable space decreases because of the hidden widget. So we can't unhide the hidden widget back.
Before: We have enough space to scroll down and made hide the Hidable
.
AppBar() // has 56 height of space
ScrollableWidget() /* has "enough" space to enable the scrolling functionality on the page
after combining its size with other widgets on the screen. */
After scrolling: AppBar() has gone via hiding the Hidable
. and now we don't have enough space to scroll up and unhide the Hidable
.
ScrollableWidget()
After scrolling: AppBar() has gone via hiding the Hidable. and now we don't have enough space to scroll up and unhide the Hidable.
Just to make sure, so you are describing the original problem, where we can't unhide the appbar when the listview is fully revealled, because the listview needs to be partially obscured for the the scrollController to work?
Exactly