b/171649782
See discussion in #69907
Suggested by @mehmetf, ScaffoldMessenger could be more helpful if it could assert when registering a Scaffold that is a descendent of an already registered Scaffold.. something like:
void _register(ScaffoldState scaffold) {
assert(_scaffolds does not contain any item that is a parent of the scaffold, 'You should really scope your Scaffolds....');
_scaffolds.add(scaffold);
if (_snackBars.isNotEmpty) {
scaffold._updateSnackBar();
}
}
We should also expand the docs on troubleshooting nested Scaffolds, and add this to the migration guide as well:
https://api.flutter.dev/flutter/material/Scaffold-class.html
https://flutter.dev/docs/release/breaking-changes/scaffold-messenger
b/171649782
See discussion in #69907
Suggested by @mehmetf, ScaffoldMessenger could be more helpful if it could assert when registering a Scaffold that is a descendent of an already registered Scaffold.. something like:
We should also expand the docs on troubleshooting nested Scaffolds, and add this to the migration guide as well:
https://api.flutter.dev/flutter/material/Scaffold-class.html
https://flutter.dev/docs/release/breaking-changes/scaffold-messenger