sliver_fill_remaining_box_adapter 0.1.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 80

Sliver Fill Remaining Box Adapter #

pub package

A flutter package providng SliverFillRemainingBoxAdapter, a sliver that fills the remaining space or shows its child, whichever is larger.

This is essentially a combination of SliverFillRemaining, which sizes its child to the remaining space even if the child wants to be larger; and SliverToBoxAdapter, which is a sliver which sizes itself to its child.

This looks something like this:

Size by ChildFilling remaining a bitFilling entire viewport
Screenshot showing sized by child heightScreenshot showing expanded slightlyScreenshot showing expanded over entire screen

Usage #

The SliverFillRemainingBoxAdapter can be used in a similar way to other slivers, particularly SliverBoxAdapter. It hasn't been tested with ShrinkWrap set to true, and shouldn't be expected to be have well in that scenario. It also hasn't been tested when it isn't the last item in the list, or when there multiple SliverFillRemainingBoxAdapter instances.

If you have any problems please let me know by opening an issue! As this is just a side-project, I can't promise to be very quick to respond but I'll do my best.

Anyone willing to make contributions are very welcome to submit PRs.

0.0.1 #

  • First push of plugin.

0.1.0 #

  • Fix readme

0.1.1 #

  • Add example readme


import 'dart:math' as math;

import 'package:flutter/material.dart';
import 'package:sliver_fill_remaining_box_adapter/sliver_fill_remaining_box_adapter.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => _MyAppState();

class _MyAppState extends State<MyApp> {
  int numItems = 3;

  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(
          title: Text("Fill remaining with $numItems boxes"),
          actions: <Widget>[
              icon: Icon(Icons.add_circle),
              onPressed: () {
                setState(() => numItems += 1);
              icon: Icon(Icons.remove_circle),
              onPressed: () {
                setState(() => numItems = numItems > 0 ? numItems - 1 : numItems);
        body: CustomScrollView(
          slivers: <Widget>[
              delegate: SliverChildBuilderDelegate(
                (context, val) => Container(
                      height: 300,
                      color: Color(0xFF000000 | math.Random(val + 12234443).nextInt(0xFFFFFF)),
                      child: Text("Item number $val"),
                childCount: numItems,
              child: Container(
                alignment: Alignment.bottomCenter,
                child: Container(
                  height: 200,
                  child: Text(
                    "This is filling the remaining or using\nits child's height if no remaining.",
                    style: TextStyle(color: Colors.white),

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  sliver_fill_remaining_box_adapter: ^0.1.1

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:sliver_fill_remaining_box_adapter/sliver_fill_remaining_box_adapter.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Apr 8, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health suggestions

Fix lib/sliver_fill_remaining_box_adapter.dart. (-1 points)

Analysis of lib/sliver_fill_remaining_box_adapter.dart reported 2 hints:

line 16 col 30: 'ancestorStateOfType' is deprecated and shouldn't be used. Use findAncestorStateOfType instead. This feature was deprecated after v1.12.1..

line 16 col 50: 'TypeMatcher' is deprecated and shouldn't be used. TypeMatcher has been deprecated because it is no longer used in framework(only in deprecated methods). This feature was deprecated after v1.12.1..

Maintenance suggestions

Package is getting outdated. (-37.26 points)

The package was last published 71 weeks ago.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8