Skip to content

Commit c446b0e

Browse files
committed
binding [nfc]: Expand toggleWakelock doc to clarify what it does
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.
1 parent 0c1965b commit c446b0e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/model/binding.dart

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,17 @@ abstract class ZulipBinding {
176176
bool requestFullMetadata,
177177
});
178178

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

0 commit comments

Comments
 (0)