Comments (9)
I found a widget that acts like you described: https://gist.github.com/tomaszpolanski/cf0edb7961d2304c2f293da9971cd4c9
from sliver_tools.
@obiwanzenobi thanks for linking that gist.
I think I already looked at this one, it indeed might be a good starting point.
Can I assume you are looking for a widget with this behavior?
If so do you perhaps have input on the two questions I posed?
from sliver_tools.
Was about to open an enhancement request till I saw this. Is there any such functionality like this within the sliver_tools
package?
I have a NestedScrollView
whose headerSliverBuilder
returns a SliverPersistentHeader
and a SliverPinnedHeader
but I want the pinned header to hide when we scroll to the bottom but show itself when we scroll to the top. This is basically the floating functionality on SliverAppBar
and the functionality described here.
I tried using the gist provided but its fairly outdated and didn't seem to work.
from sliver_tools.
I actually use this to achieve a certain behaviour. Regarding your questions I think it already behaves like I would expect it.
Regarding your questions
What if this is combined with a regular pinned header before/after it
If all FloatingHeader are in a Group of PersistentHeaders (Pinned, Floating) In that case the FloatingHeader should scroll away but not be effecting by Overscroll Effects when dragging down For example
What should the behavior be when multiple of these headers are added to a viewport
If there is a non persistent Sliver between multiple of these headers it should behave more or less like aSliverToBoxAdapter
from sliver_tools.
Was about to open an enhancement request till I saw this. Is there any such functionality like this within the
sliver_tools
package?I have a
NestedScrollView
whoseheaderSliverBuilder
returns aSliverPersistentHeader
and aSliverPinnedHeader
but I want the pinned header to hide when we scroll to the bottom but show itself when we scroll to the top. This is basically the floating functionality onSliverAppBar
and the functionality described here.I tried using the gist provided but its fairly outdated and didn't seem to work.
I tried the example in the gist of tomaszpolanski and for me it actually works well.
In fact I merged the SliverPinnedHeader of this package and the code of that gist and created an hybrid that takes a parameter named floating
that triggers the floating behavior.
I used it in a real scenario with the first sliver header set as floating and the second one pinned (without setting floating: true
) and it works fine.
Here the new widget that I named SliverFlexibleHeader: https://gist.github.com/marcoredz/b2a37ff2cd11f81fa4ff7fb004fbb0ab
@Kavantix any opinions about this? maybe it could be a nice feature to add to your package
from sliver_tools.
@marcoredz I took a quick look at your implementation and it looks like a good starting point.
You can open a PR for it if you want
from sliver_tools.
@Kavantix what do you suggest between: taking the existing SliverPinnedHeader and editing it, or creating a new widget?
from sliver_tools.
I would create a new one for this
from sliver_tools.
It doesn't work when it's put inside MultiSliver
or SliverMainAxisGroup
from sliver_tools.
Related Issues (20)
- Package Performance Hit? HOT 1
- Multisliver: Local hitTest position on sliver child is calculated wrong.
- SliverPinnedHeader and detecting overlapping (i.e. overlapsContent) HOT 1
- Is there any way I can listen when the header sticks to the top?
- Add SliverClip.clipBehavior
- SliverPinnedHeader add offsetTop can not work correctly HOT 3
- issues with dynamic list data HOT 2
- AbstractNode is deprecated
- Error: A constant constructor can't call a non-constant super constructor. HOT 2
- Workaround for adding Sliver into an IndexedStack HOT 1
- Flutter 3.13 Compatibility HOT 2
- `SliverList` breaks alignment in `SliverStack` HOT 2
- Flutter build fails with error after new update! HOT 4
- Question: Trying to combine a SliverPinnedHeader with an SliverAppBar that has a bottom widget HOT 4
- Missing tag on GitHub HOT 2
- [Enhancement Request] SliverAnimationSwitcher with transitionBuilder HOT 1
- sliver_tools vs normal slivers HOT 1
- Please provide the full example code from the gif HOT 3
- Multiple SliverPinnedHeader overlapping HOT 2
- How to make it fit with custom ExpansionTile Widget ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sliver_tools.