snap property

bool snap
final

Controls the behavior of a floating app bar when the user scrolls.

When snap is false, the app bar will move smoothly with the content as the user scrolls, and will be dismissed smoothly when the user scrolls down.

When snap is true, the app bar will have a more rigid behavior. It will snap into view when the user scrolls up and snap out of view when the user scrolls down. Additionally, when the user interacts with any part of the fully into view so that the user can see and interact with all of its contents.

Animated Examples

The following animations show how the app bar changes its scrolling behavior based on the value of this property.

  • App bar with snap set to false:
  • App bar with snap set to true:

This property only applies to floating app bars.

See also:

Implementation

final bool snap;