Skip to content

Commit

Permalink
binding [nfc]: Expand toggleWakelock doc to clarify what it does
Browse files Browse the repository at this point in the history
This method's name is based on the library it wraps, which is good.
But that library's name is misleading.  So add more details to the
doc than we usually do for these binding methods, to clear that up.
  • Loading branch information
gnprice committed Sep 24, 2024
1 parent 2bc38ab commit 3c782cf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/model/binding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,17 @@ abstract class ZulipBinding {
bool requestFullMetadata,
});

/// Enables or disables screen wakelock, via package:wakelock_plus.
/// Enables or disables keeping the screen on, via package:wakelock_plus.
///
/// This wraps [wakelock_plus.WakelockPlus.toggle].
///
/// Despite the name, this does not involve Android's "wake locks".
/// The implementation sets FLAG_KEEP_SCREEN_ON on Android:
/// https://developer.android.com/develop/background-work/background-tasks/awake/screen-on
/// https://github.com/fluttercommunity/wakelock_plus/blob/5ca5243e7894830ce289fc367bc5fdec27c7f0cf/wakelock_plus/android/src/main/kotlin/dev/fluttercommunity/plus/wakelock/Wakelock.kt
/// and idleTimerDisabled on iOS:
/// https://developer.apple.com/documentation/uikit/uiapplication/1623070-idletimerdisabled
/// https://github.com/fluttercommunity/wakelock_plus/blob/5ca5243e7894830ce289fc367bc5fdec27c7f0cf/wakelock_plus/ios/Classes/WakelockPlusPlugin.m
Future<void> toggleWakelock({required bool enable});
}

Expand Down

0 comments on commit 3c782cf

Please sign in to comment.