Search packages, repositories and app categories

GitHub repositoryMayLau-CbL/sticky-footer-scrollview

sticky-footer-scrollview

A Flutter Widget that is scrollable with a sticky footer either stick to the bottom of screen of the end of the scroll body.

sticky-footer-scrollview project cover
Stars
5
Forks
2
Last push (UTC)
Jun 15, 2022
Project status
Active

Original README

English project snapshot. Visit GitHub for the latest content.

sticky_footer_scrollview

pub package

A Flutter Widget that is scrollable with a sticky footer either stick to the bottom of screen of the end of the scroll body.

Background

This package using SingleScrollView and CustomMultiChildLayout to acheive a scrollable widget with a sticky footer. This allow a dynamic height of child widgets in scroll body.

At the same time, because of the SingleScrollView with Column approach, this is not recommended to use with lots of child widgets for performance reason. You may simiply test with the example to see whether it is fit for your case.

Usage

This shows Widget's full customizations:

StickyFooterScrollView({    
    this.footer,
    @required this.itemBuilder,
    @required this.itemCount,
    this.scrollController,
})
  1. footer is the footer widget that is placed either at the bottom of screen or the end of the scroll body.
  2. itemBuilder to build child widgets of scroll body
  3. itemCount is the nunber of child widgets in scroll body. Only allows >= 0.
  4. scrollController allows maunally jump to certain offset position.

Example

when scrollbody is shorter than the avialble widget height

when scrollbody is longer than the avialble widget height

@override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
        body: StickyFooterScrollView(
          itemCount: 50,
          itemBuilder: (context, index) {
            return Card(
              child: ListTile(
                title: Text('content $index'),
              ),
              color: Colors.pinkAccent,
            );
          },
          footer: AppBar(
            title: Text('i stick at bottom'),
          ),
        ),
      ),
    );
  }

Lisence

MIT

May Lau GitHub avatar
GitHub author

May Lau ↗

Interested in frontend development, currently especially on flutter development.

LanguagesDartHTMLSwiftKotlinObjective-C

Categories

Packages published by this repository

Dependencies used

Dependency list 2 items

  • flutter{"sdk":"flutter"}
  • flutter_testDevelopment{"sdk":"flutter"}

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗