wakelockPlatformInstance top-level property

  1. @visibleForTesting
WakelockPlatformInterface wakelockPlatformInstance
getter/setter pair

The WakelockPlatformInterface that is used by Wakelock.

This needs to be exposed for testing as unit tests might run on macOS. In that case, the "hacky" instance override that we use here would be triggered for the unit tests, even though the unit tests should actually test the pigeon method channel implementation. Therefore, we want to override this in tests that run on macOS (where there is no actual device).

Implementation

@visibleForTesting
var wakelockPlatformInstance = _defaultPlatformInstance;