sliver_fill_remaining_box_adapter
1.0.0, released 5 years ago by an unverified publisher
A sliver that fills remaining space or shows its child, whichever is larger.
WASM-ready
What it does
It combines SliverFillRemaining and SliverToBoxAdapter to provide a sliver that either expands to fill the remaining viewport or sizes itself to its child if the child is larger. The widget is null‑safe and works with the latest Flutter SDK.
AI-written summary of version 1.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a sliver that expands to fill the remaining space in a CustomScrollView.
- You want a single‑purpose sliver that behaves like SliverToBoxAdapter but can also fill the viewport.
- You are building a scrollable layout that requires a flexible child size without custom layout code.
Skip it when
- You are using shrinkWrap:true on the scroll view.
- You need multiple instances of this sliver in the same scroll view.
- You require guaranteed behavior when the sliver is not the last item in the list.
Strengths
- Simple API, no extra dependencies.
- Null safety and compatible with latest Flutter.
- Fills remaining space or sizes to child automatically.
Weaknesses
- Not tested with shrinkWrap:true or multiple instances.
- Behavior uncertain if not the last sliver in the list.
- No advanced configuration options.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
```dart
CustomScrollView(
slivers: [
SliverFillRemainingBoxAdapter(
child: Container(color: Colors.blue, height: 200),
),
],
);
```