state.dart 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import 'dart:collection';
  2. import 'package:get/get.dart';
  3. import 'package:vitalapp/store/store.dart';
  4. import 'models/menu.dart';
  5. class HomeState {
  6. final RxList<HomeMenuItem> _menuItems = RxList.empty();
  7. final RxString _currentSelectMenu = RxString('/medical');
  8. final RxBool _isOnline = RxBool(true);
  9. /// 版本号
  10. String get version => "1.0.0.100";
  11. /// 医生名称
  12. String get doctorName => Store.user.displayName;
  13. /// 团队名称
  14. String get doctorTeamName => Store.user.teamName;
  15. String get headImageToken => Store.user.headImageToken;
  16. // set headImageToken(String val) => _headImageToken.value = val;
  17. /// 菜单项集合
  18. List<HomeMenuItem> get menuItems => UnmodifiableListView(_menuItems.toList());
  19. set menuItems(Iterable<HomeMenuItem> val) =>
  20. _menuItems.value = List<HomeMenuItem>.from(val).obs;
  21. /// 当前选中菜单
  22. String get currentSelectMenu => _currentSelectMenu.value;
  23. set currentSelectMenu(String val) => _currentSelectMenu.value = val;
  24. /// 状态
  25. bool get isOnline => _isOnline.value;
  26. set isOnline(bool val) => _isOnline.value = val;
  27. }