coordinator_layout 0.0.4+4 copy "coordinator_layout: ^0.0.4+4" to clipboard
coordinator_layout: ^0.0.4+4 copied to clipboard

outdated

a Library contains widget/layout to handle collapsing header behavior

coordinator_layout #

Example #

CoordinatorLayout(
    maxHeight: 200,
    minHeight: kToolbarHeight + MediaQuery.of(context).padding.top,
    headers: [
        SliverCollapsingHeader(
            builder: (context, offset, diff) {
                return AppBar(
                title: Text("Home"),
                bottom: PreferredSize(
                    preferredSize: Size.fromHeight(diff),
                    child: Container(color: Colors.white),
                ),
                );
            },
        ),
    ],
    body: Container(height: null, child: buildBody(context)),
),

Fit content

CoordinatorLayout(
    headerMaxHeight: 200,
    headerMinHeight: kToolbarHeight + MediaQuery.of(context).padding.top,
    header:[ 
        Builder(builder: (context) {
            return SliverOverlapAbsorber(
            handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
            sliver: SliverSafeArea(
                top: false,
                sliver: SliverCollapsingHeader(
                builder: (context, offset, diff) {
                    return AppBar(
                    title: Text("Home"),
                    bottom: PreferredSize(
                        preferredSize: Size.fromHeight(diff),
                        child: Container(color: Colors.white),
                    ),
                    );
                },
                ),
            ),
            );
        }),
    ],
    body: Container(height: null, child: buildBody(context)),
),
4
likes
0
pub points
73%
popularity

Publisher

verified publisherzariman.dev

a Library contains widget/layout to handle collapsing header behavior

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on coordinator_layout