sliver_fill_remaining_box_adapter 0.1.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new64

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

example/README.md

Sliver Fill Remaining Box Adapter Example

The example code demonstrates how to use the sliver_fill_remaining_box_adapter plugin.


CustomScrollView(
  slivers: <Widget>[
    /*<other slivers>,*/
    SliverFillRemainingBoxAdapter(
      child: Container(
        color: Colors.black,
        alignment: Alignment.bottomCenter,
        child: Container(
          height: 200,
          alignment: Alignment.center,
          child: Text(
            "This is filling the remaining or using\nits child's height if no remaining.",
            style: TextStyle(color: Colors.white),
            textAlign: TextAlign.center,
          ),
        ),
      ),
    ),
  ],
);

Use this package as a library

1. Depend on it

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


dependencies:
  sliver_fill_remaining_box_adapter: ^0.1.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages 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';
  
Version Uploaded Documentation Archive
0.1.1 Nov 23, 2018 Go to the documentation of sliver_fill_remaining_box_adapter 0.1.1 Download sliver_fill_remaining_box_adapter 0.1.1 archive
0.1.0 Nov 23, 2018 Go to the documentation of sliver_fill_remaining_box_adapter 0.1.0 Download sliver_fill_remaining_box_adapter 0.1.0 archive
0.0.1 Nov 23, 2018 Go to the documentation of sliver_fill_remaining_box_adapter 0.0.1 Download sliver_fill_remaining_box_adapter 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
29
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
64
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7
  • Flutter: 1.0.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

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
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8