FakeScreenSecurity class

A host-VM fake ScreenSecurity — counts the backup screen's protection requests so a widget test can assert it engages on show and releases on dispose. isScreenshotBlockSupported is configurable so a test can drive both the Android (block) and the elsewhere (advise-a-private-setting) copy.

Implemented types

Constructors

FakeScreenSecurity({bool isScreenshotBlockSupported = true, bool? engages})

Properties

disableCount ↔ int
getter/setter pair
enableCount ↔ int
getter/setter pair
engages → bool
What enable reports back — whether the (fake) native side ENGAGED. Defaults to the capability, mirroring a correctly wired host; pass engages: false to play a capable platform whose host never wired the native handler (the B1 shape — the UI must stay pessimistic).
latefinal
hashCode → int
The hash code for this object.
no setterinherited
isScreenshotBlockSupported → bool
Whether THIS platform can actually block screenshots (Android only). The CAPABILITY signal used for adapter selection and by the test fakes — the UI copy no longer reads it (engagement truth is enable's return).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

disable() → Future<void>
Release the protection when the sensitive screen leaves the tree.
override
enable() → Future<bool>
Request that the OS prevent screenshots / hide the screen from the app switcher while the sensitive screen is visible. Best-effort and idempotent; a failure never breaks the screen (the protection is defence-in-depth, not the gate).
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited