keyboard_android_platform_interface.dart 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import 'package:plugin_platform_interface/plugin_platform_interface.dart';
  2. import 'keyboard_android_method_channel.dart';
  3. abstract class KeyboardAndroidPlatform extends PlatformInterface {
  4. /// Constructs a KeyboardAndroidPlatform.
  5. KeyboardAndroidPlatform() : super(token: _token);
  6. static final Object _token = Object();
  7. static KeyboardAndroidPlatform _instance = MethodChannelKeyboardAndroid();
  8. /// The default instance of [KeyboardAndroidPlatform] to use.
  9. ///
  10. /// Defaults to [MethodChannelKeyboardAndroid].
  11. static KeyboardAndroidPlatform get instance => _instance;
  12. /// Platform-specific implementations should set this with their own
  13. /// platform-specific class that extends [KeyboardAndroidPlatform] when
  14. /// they register themselves.
  15. static set instance(KeyboardAndroidPlatform instance) {
  16. PlatformInterface.verifyToken(instance, _token);
  17. _instance = instance;
  18. }
  19. Future<String?> getPlatformVersion() {
  20. throw UnimplementedError('platformVersion() has not been implemented.');
  21. }
  22. Future<void> enableFloatingWindow(bool enable) {
  23. throw UnimplementedError(
  24. 'enableFloatingWindow(bool enable) has not been implemented.',
  25. );
  26. }
  27. void jumpFloatingWindowSetting() {
  28. throw UnimplementedError(
  29. 'jumpFloatingWindowSetting() has not been implemented.',
  30. );
  31. }
  32. Future<bool> hasFloatingWindowPermission() {
  33. throw UnimplementedError(
  34. 'hasFloatingWindowPermission() has not been implemented.',
  35. );
  36. }
  37. Future<void> openInputMethodSettings() {
  38. throw UnimplementedError(
  39. 'openInputMethodSettings() has not been implemented.',
  40. );
  41. }
  42. Future<bool> isTargetKeyboardEnabled() {
  43. throw UnimplementedError(
  44. 'isTargetKeyboardEnabled() has not been implemented.',
  45. );
  46. }
  47. // /// 获取键映射(需要在 `MethodChannelKeyboardAndroid` 实现)
  48. // Future<List<Map<String, String>>> getKeyMappings() {
  49. // throw UnimplementedError('getKeyMappings() has not been implemented.');
  50. // }
  51. //
  52. // /// 设置键映射(需要在 `MethodChannelKeyboardAndroid` 实现)
  53. // Future<bool> setKeyMappings(List<Map<String, String>> mappings) {
  54. // throw UnimplementedError('setKeyMappings() has not been implemented.');
  55. // }
  56. //
  57. // /// 通过方法名获取动态文本
  58. // Future<String?> getDynamicText(String method) {
  59. // throw UnimplementedError('getDynamicText() has not been implemented.');
  60. // }
  61. }