rubber_app_bar library

A customizable app bar that can be expanded and collapsed with rubber-like behavior.

The RubberAppBar is a widget that provides a flexible app bar that can be expanded and collapsed with a rubber-like behavior. It allows you to specify the initial height, maximum extent, and transition duration of the app bar. You can also define callbacks for when the app bar is going up, going down, reaching the top, or reaching the bottom.

The RubberAppBar can be used as a regular AppBar by setting the mode property to RubberAppBarMode.movementDirection. In this mode, the app bar will expand and collapse based on the direction of the user's gesture. Alternatively, you can set the mode property to RubberAppBarMode.halfWay to make the app bar always expand halfway or collapse halfway.

To use the RubberAppBar, simply wrap it around your content and provide a builder function that returns the content based on the current extent of the app bar. The extent value can be used to animate the content based on the app bar's height.

Example usage:

RubberAppBar(
  height: 100,
  maxExtent: 200,
  transitionDuration: Duration(milliseconds: 500),
  mode: RubberAppBarMode.movementDirection,
  builder: (double extent) {
    return Container(
      height: extent,
      color: Colors.blue,
      child: Text('Content'),
    );
  },
)

Classes

RubberAppBar

Enums

RubberAppBarMode
Enum representing the mode of the RubberAppBar.