Hibok
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

55 行
2.3 KiB

  1. import 'dart:async';
  2. import 'package:flutter/services.dart';
  3. class FlutterWindowManager {
  4. // Flags for WindowManager.LayoutParams, as per
  5. // https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html
  6. static const int FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001;
  7. static const int FLAG_ALT_FOCUSABLE_IM = 0x00020000;
  8. static const int FLAG_DIM_BEHIND = 0x00000002;
  9. static const int FLAG_FORCE_NOT_FULLSCREEN = 0x00000800;
  10. static const int FLAG_FULLSCREEN = 0x00000400;
  11. static const int FLAG_HARDWARE_ACCELERATED = 0x01000000;
  12. static const int FLAG_IGNORE_CHEEK_PRESSES = 0x00008000;
  13. static const int FLAG_KEEP_SCREEN_ON = 0x00000080;
  14. static const int FLAG_LAYOUT_INSET_DECOR = 0x00010000;
  15. static const int FLAG_LAYOUT_IN_SCREEN = 0x00000100;
  16. static const int FLAG_LAYOUT_NO_LIMITS = 0x00000200;
  17. static const int FLAG_NOT_FOCUSABLE = 0x00000008;
  18. static const int FLAG_NOT_TOUCHABLE = 0x00000010;
  19. static const int FLAG_NOT_TOUCH_MODAL = 0x00000020;
  20. static const int FLAG_SCALED = 0x00004000;
  21. static const int FLAG_SECURE = 0x00002000;
  22. static const int FLAG_SHOW_WALLPAPER = 0x00100000;
  23. static const int FLAG_SPLIT_TOUCH = 0x00800000;
  24. static const int FLAG_WATCH_OUTSIDE_TOUCH = 0x00040000;
  25. static const int FLAG_BLUR_BEHIND = 0x00000004;
  26. static const int FLAG_DISMISS_KEYGUARD = 0x00400000;
  27. static const int FLAG_DITHER = 0x00001000;
  28. static const int FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS = 0x80000000;
  29. static const int FLAG_LAYOUT_ATTACHED_IN_DECOR = 0x40000000;
  30. static const int FLAG_LAYOUT_IN_OVERSCAN = 0x02000000;
  31. static const int FLAG_LOCAL_FOCUS_MODE = 0x10000000;
  32. static const int FLAG_SHOW_WHEN_LOCKED = 0x00080000;
  33. static const int FLAG_TOUCHABLE_WHEN_WAKING = 0x00000040;
  34. static const int FLAG_TRANSLUCENT_NAVIGATION = 0x08000000;
  35. static const int FLAG_TRANSLUCENT_STATUS = 0x04000000;
  36. static const int FLAG_TURN_SCREEN_ON = 0x00200000;
  37. static const MethodChannel _channel =
  38. const MethodChannel('flutter_windowmanager');
  39. static Future<bool> addFlags(int flags) async {
  40. return await _channel.invokeMethod("addFlags", {
  41. "flags": flags,
  42. });
  43. }
  44. static Future<bool> clearFlags(int flags) async {
  45. return await _channel.invokeMethod("clearFlags", {
  46. "flags": flags,
  47. });
  48. }
  49. }