double getExpandedHeightFor(BuildContext context)

Returns the expandedHeight of the AppBar nearest to the given BuildContext.

Calling this function sets up an inheritance relationship, so that the widget corresponding to the given BuildContext will rebuild whenever that height changes.

Source

static double getExpandedHeightFor(BuildContext context) {
  _AppBarExpandedHeight marker = context.inheritFromWidgetOfExactType(_AppBarExpandedHeight);
  return marker?.expandedHeight ?? 0.0;
}