isFocused property
Indicates whether the application's window is in focus.
Implementation
Future<bool> get isFocused async {
if (isWeb) {
return Future.value(WebUtils.isFocused);
} else if (isDesktop) {
try {
return await WindowManager.instance.isFocused();
} on MissingPluginException {
return true;
}
} else {
return Future.value(router.lifecycle.value.inForeground);
}
}