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