environmentOf method
Gets the WerkbankEnvironment of the current addon. This is one of WerkbankEnvironment.app or WerkbankEnvironment.display. This can be used by addons for example to omit certain visual overlays or similar with a DisplayApp widget, since they only make sense in an environment where the user interacts with the WerkbankApp application.
The value can be assumed to be constant for the lifetime of the widget that uses it. This means that widgets that change the widgets that are built depending on its value do not need to reparent children widgets using GlobalKeys to prevent state loss.
Implementation
WerkbankEnvironment environmentOf(BuildContext context) {
return WerkbankEnvironmentProvider.of(context);
}