Fix: ScaffoldMessenger.of() was called with a context that does not contain a Scaffold (Flutter)
This error means the BuildContext you passed is above the Scaffold or ScaffoldMessenger, not below it. Wrap the caller in a Builder, extract it into its own widget, or use a GlobalKey.