instance property
WidgetsBinding?
get
instance
The current WidgetsBinding, if one has been created. Provides access to the features exposed by this mixin. The binding must be initialized before using this getter; this is typically done by calling runApp or WidgetsFlutterBinding.ensureInitialized.
Implementation
WidgetsBinding? get instance {
try {
return _ambiguate(WidgetsBinding.instance);
} catch (e, s) {
_hub.options.logger(
SentryLevel.error,
'WidgetsBinding.instance was not yet initialized',
exception: e,
stackTrace: s,
logger: 'BindingWrapper',
);
if (_hub.options.automatedTestMode) {
rethrow;
}
return null;
}
}