align method

  1. @override
AppBarAlignmentCommand? align(
  1. AppBarPosition appBar,
  2. NestedScrollPosition scroll
)
override

Determines the alignment of the appbar based on appbar position and scroll.

Implementation

@override
AppBarAlignmentCommand? align(
  AppBarPosition appBar,
  NestedScrollPosition scroll,
) {
  if (alignAnimation) {
    return appBar.expandedPercent < 0.5 ? .shrink : .expand;
  }

  return null;
}