align method

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
        ? AppBarAlignmentCommand.shrink
        : AppBarAlignmentCommand.expand;
  }

  return null;
}