setFloatingActionButtonNotchFor method

VoidCallback setFloatingActionButtonNotchFor (BuildContext context, ComputeNotch computeNotch)

Sets the ScaffoldGeometry.floatingActionButtonNotch for the closest Scaffold ancestor of the given context, if one exists.

It is guaranteed that computeNotch will only be used for making notches in the top edge of the bottomNavigationBar, the start and end offsets given to it will always be on the top edge of the bottomNavigationBar, the start offset will be to the left of the floating action button's bounds, and the end offset will be to the right of the floating action button's bounds.

Returns null if there was no Scaffold ancestor. Otherwise, returns a VoidCallback that clears the notch maker that was set.

Callers must invoke the callback when the notch is no longer required. This method is typically called from State.didChangeDependencies and the callback should then be invoked from State.deactivate.

If there was a previously set ScaffoldGeometry.floatingActionButtonNotch it will be overridden.

Implementation

static VoidCallback setFloatingActionButtonNotchFor(BuildContext context, ComputeNotch computeNotch) {
  final _ScaffoldScope scaffoldScope = context.inheritFromWidgetOfExactType(_ScaffoldScope);
  if (scaffoldScope == null)
    return null;
  return scaffoldScope.geometryNotifier._updateFloatingActionButtonNotch(computeNotch);
}