Skip to content
pubscout

flutter_collapsing_toolbar

1.0.0, released 5 years ago by romanticdeveloper.com

A widget that provides a collapsible toolbar with customizable header and actions.

WASM-ready
$ flutter pub add flutter_collapsing_toolbar
Source repository

What it does

The CollapsingToolbar widget expands and collapses as the user scrolls, allowing you to place a header, title, leading widget, and actions. It can be embedded in any ScrollView or ListView and exposes callbacks for collapse events.

AI-written summary of version 1.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a collapsible toolbar in a scrollable layout
  • You want a simple, customizable header that reacts to scroll
  • You want to integrate a toolbar into complex scroll views without custom animation code

Skip it when

  • You require advanced animation or physics beyond a simple collapse
  • You need a fully featured app bar with tabs or bottom navigation

Strengths

  • Easy to use declarative API
  • Supports custom leading, title, actions, and feature icons
  • Works with any ScrollView or ListView

Weaknesses

  • Limited to basic collapse behavior
  • No built‑in support for tabs or bottom navigation
  • Not actively maintained (last release 2021)

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0

Add dependency to pubspec and import the package; no special permissions or build_runner needed

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

class Demo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final controller = ScrollController();
    return Scaffold(
      body: Column(
        children: [
          CollapsingToolbar(
            controller: controller,
            expandedHeight: 200,
            collapsedHeight: 64,
            title: Text('Demo'),
            leading: Icon(Icons.menu),
          ),
          Expanded(
            child: ListView.builder(
              controller: controller,
              itemCount: 20,
              itemBuilder: (_, i) => ListTile(title: Text('Item $i')),
            ),
          ),
        ],
      ),
    );
  }
}

Alternatives

Packages that do the same job and could replace flutter_collapsing_toolbar.