Comments (8)
I have emailed you the current version of the SliverFillRemainingWithMinimum widget
If you agree that it solves this issue we should start on a PR to add it to the package
from sliver_tools.
@martipello it wasnt what he needed, feel free to open an issue if youβre running into something
from sliver_tools.
I cannot reproduce your issue.
Could you provide a complete and minimal example?
from sliver_tools.
Parent widget would be:
class ExampleParentScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
extendBody: true,
backgroundColor: Themes.white,
bottomNavigationBar: const NavigationWidget(),
body: CustomScrollView(
physics: BouncingScrollPhysics(),
slivers: <Widget>[
const ExampleAppBarWidget(),
const ExampleWidget()
],
),
);
},
}
And ExampleAppBarWidget:
class ExampleAppBarWidget extends StatelessWidget {
static const double collapsedHeight = 57.0;
static const double expandedHeight = 465.0;
const ExploreAppBarWidget();
@override
Widget build(BuildContext context) {
return SliverPersistentHeader(
pinned: true,
delegate: _SliverAppBarDelegate(
minHeight: collapsedHeight + MediaQuery.of(context).padding.top,
maxHeight: expandedHeight + MediaQuery.of(context).padding.top),
);
}
}
class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
final double minHeight;
final double maxHeight;
_SliverAppBarDelegate({
@required this.minHeight,
@required this.maxHeight,
});
@override
double get minExtent => minHeight;
@override
double get maxExtent => max(maxHeight, minHeight);
@override
Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) {
return Container(
color: Colors.red
);
}
@override
bool shouldRebuild(_SliverAppBarDelegate oldDelegate) {
return false;
}
}
from sliver_tools.
Using your code and having the child as a simple container:
class ExampleItemWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
height: 100,
width: double.infinity,
color: Colors.green,
margin: const EdgeInsets.all(8),
);
}
}
I get this result when setting the fillremaining to blue so it seems to work
Are you using 0.1.10+1
?
from sliver_tools.
Now Imagine scrolling up so the appbar collapses: the red gets smaller, and the blue gets proportionally bigger. In 1.0.9 that was the behaviour if you didn't specify height to the Container (or SizedBox). In 1.1.10+1 the blue part wont resize so the appbar is not collapsable. You could give a scrollbody to the SliverFillRemaining but then the blue part would be viewport height, and the green list items would be scrollable offscreen. The intended behaviour is that if I have less items in the list than would fill the screen, then SliverFillRemaining would fill the missing part so the appbar is fully collapsable (otherwise the appbar would only be collapsable to the extent I have list items).
The use case would be a situation where I can add and remove items to and from the list. Or better example, I wouldn't want a situation where I only see partly expanded or collapsed appbar assuming I'm showing different content whether it is fully expanded or collapsed.
from sliver_tools.
Sadly I must tell you that the behaviour 0.1.9 had was actually incorrect.
The current version behaves the same as if you didn't place the widgets inside a MuliSliver but directly inside the CustomScrollView.
I do actually have an adapted version of SliverFillRemaining in my private code (it's not open source ready) that allows you to specify a minimum amount of scroll that the SliverFillRemaining should provide.
If you want I can mail it to you and perhaps we can work together to get it included in this package.
from sliver_tools.
how did this end?
from sliver_tools.
Related Issues (20)
- 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 HOT 1
- 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
- Add SliverSizeTransition HOT 6
- MultiSliver fails in a shrinkwrapped, unconstrained CustomScrollView 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.