-
Notifications
You must be signed in to change notification settings - Fork 568
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
Layout within Scroll
#799
Comments
yes, I've been thinking about this in the past couple days; the current ways to achieve this are hacky, like having a parent widget of the |
I've got a half baked scrollbar PR sitting around right now which allows scrollbars to be inlay instead of painting over the child content and this is very close to an issue I'm having. When adding content to a Scroll in the I also want to expand to the Scroll's size in my text editor project so any ideas on how to improve this would be awesome |
yea, there are a few things here. I think one simple improvement is to make For this to make sense, we also want to make sure scroll has a clear size? Does it make sense for the size of the scroll widget to be determined by the size of the child? I think maybe not; maybe the scroll should always have a fixed size (and so be passed tight constraints?) |
I think it would make sens for |
yes, I think that makes more sense. |
I've been putting a bit of thought into this over the past few days as I continue to exercise the scroll widget in my text editor project and I've come to the conclusion that perhaps scrolling should be some kind of functionality that widgets should be able to embed in themselves somehow. Split up the functionality and let widgets pick and choose which parts to use. I'm not sure what level of abstraction is most suitable but some scroll building blocks would be handy. This would allow the generic scroll widget to continue to exist (albeit calling out to these scroll building blocks) but there can also be more focused scrolling widgets re-using this same functionality (such as vertical lists). This is important as some widgets need a closer tie to their scrolling behaviour such as text edit widget which needs to know/manipulate the current scroll value as well as take up the full space or a tab bar which might want to reuse the scrollbar rendering but have different behaviour. Perhaps I'm barking up the wrong tree with this idea but I think it has some merits and I'm interested to hear other's thoughts on it |
I think something like this makes sense; we would break the scrolling stuff up into a "clipping widget" and then the mechanics of actually scrolling. the clipping widget would be some widget that shows an offset region of a child. |
Closing in favour of #73 |
I would like to have the child of a
Scroll
widget take up at least the visible area of theScroll
, but I can't figure out how using the current API.As a motivating example, suppose I want to write a note-taking app with infinite scrolling. I try to do this by putting a
Drawing
widget inside aScroll
. Initially, I want theDrawing
to take up the whole visible area of theScroll
but no more. As the drawing gets bigger, I want it to be scrollable. The issue is that there doesn't appear to be a way forDrawing
's layout function to know how big theScroll
is: it just gets to see unconstrained bounds.For example of what is done elsewhere, Flutter has a sort of custom layout protocol within scrollable widgets.
The text was updated successfully, but these errors were encountered: