Hibok
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

37 regels
733 B

  1. import 'package:flutter/material.dart';
  2. class KeyboardIndexProvider with ChangeNotifier {
  3. int curKeyboardIndex = -1;
  4. bool soundPlayMode = false;
  5. bool readOnly = true;
  6. init(bool bl) {
  7. soundPlayMode = bl;
  8. }
  9. changeSoundPlayMode(bool playmode) {
  10. soundPlayMode = playmode;
  11. notifyListeners();
  12. }
  13. changeReadOnlyKey(bool emoji) {
  14. readOnly = emoji;
  15. notifyListeners();
  16. }
  17. changeSelectIndex(int newIndex) {
  18. if (newIndex != curKeyboardIndex) {
  19. curKeyboardIndex = newIndex;
  20. if (newIndex != 0) {
  21. readOnly = true;
  22. }else{
  23. readOnly = false;
  24. }
  25. print('设置当前键盘 $newIndex');
  26. notifyListeners();
  27. }
  28. }
  29. }