ScaffoldFinder class abstract

Finds the ScaffoldState whose chrome an overlay shown from a given context will appear over.

Scaffold.maybeOf only walks upwards, so it misses the very common shape where a page shows an overlay from its own build/State context:

Widget build(BuildContext context) {   // <- this context is ABOVE the Scaffold
  return Scaffold(appBar: AppBar(...), body: ...);
}

void _onSaved() => context.show(...);  // must still clear the app bar

This helper keeps the unambiguous upward answer as the first choice and only descends when there is none.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

maybeOf(BuildContext context) ScaffoldState?
Returns the closest ScaffoldState above context, or the first one below it if there is none above.