wantsMobileMagnifierToBeVisible static method
Returns true
if SuperReader's policy believes that a mobile magnifier
should be visible right now, or false
otherwise.
This inspection is different from isMobileMagnifierVisible in a couple ways:
- On mobile web, SuperReader defers to the browser's built-in overlay
controls. Therefore, wantsMobileMagnifierToBeVisible is
true
but isMobileMagnifierVisible isfalse
. - When an app customizes the magnifier, SuperReader might want to build
and display a magnifier, but the app overrode the magnifier widget and chose
to build empty space instead of a magnifier. In this case
wantsMobileMagnifierToBeVisible is
true
, but isMobileMagnifierVisible isfalse
.
Implementation
static bool wantsMobileMagnifierToBeVisible([Finder? superReaderFinder]) {
// TODO: add Android support
final magnifierManager = find.state<SuperReaderIosMagnifierOverlayManagerState>(superReaderFinder);
if (magnifierManager == null) {
throw Exception(
"Tried to verify that SuperReader wants mobile magnifier to be visible, but couldn't find the magnifier manager widget.");
}
return magnifierManager.wantsToDisplayMagnifier;
}