Sliver Fill Remaining Box Adapter #
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 Child||Filling remaining a bit||Filling entire viewport|
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.
- First push of plugin.
- Fix readme
- Add example readme
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:
$ 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:
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]
We analyzed this package on Feb 18, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.7.1
- pana: 0.13.5
- Flutter: 1.12.13+hotfix.7
lib/sliver_fill_remaining_box_adapter.dart. (-1 points)
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..
Package is getting outdated. (-23.56 points)
The package was last published 64 weeks ago.