Skip to content

Commit 19cbe3b

Browse files
committed
feat: Buat method channel untuk panggil function pengecekan accessibility permission di macos
1 parent df3bbcb commit 19cbe3b

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

lib/core/util/platform_channel_helper.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class PlatformChannelHelper {
1313
final _keyInvokeMethodQuitApp = 'quit_app';
1414
final _keyInvokeMethodTakeScreenshot = 'take_screenshot';
1515
final _keyInvokeMethodCheckPermissionScreenRecording = 'check_permission_screen_recording';
16+
final _keyInvokeMethodCheckPermissionAccessibility = 'check_permission_accessibility';
1617

1718
// Event channel
1819
final _eventChannelName = 'dipantau/event';
@@ -109,4 +110,14 @@ class PlatformChannelHelper {
109110
return false;
110111
}
111112
}
113+
114+
Future<bool?> checkPermissionAccessibility() async {
115+
try {
116+
final result = await _methodChannel.invokeMethod<bool>(_keyInvokeMethodCheckPermissionAccessibility);
117+
return result;
118+
} catch (error) {
119+
debugPrint('Error check permission accessibility: $error');
120+
return false;
121+
}
122+
}
112123
}

0 commit comments

Comments
 (0)