import 'dart:collection';
import 'package:get/get.dart';
import 'package:vitalapp/store/store.dart';

import 'models/menu.dart';

class HomeState {
  final RxList<HomeMenuItem> _menuItems = RxList.empty();
  final RxString _currentSelectMenu = RxString('/medical');
  final RxBool _isOnline = RxBool(true);

  /// 版本号
  String get version => "1.0.0.100";

  /// 医生名称
  String get doctorName => Store.user.displayName;

  /// 团队名称
  String get doctorTeamName => Store.user.teamName;

  String get headImageToken => Store.user.headImageToken;
  // set headImageToken(String val) => _headImageToken.value = val;

  /// 菜单项集合
  List<HomeMenuItem> get menuItems => UnmodifiableListView(_menuItems.toList());
  set menuItems(Iterable<HomeMenuItem> val) =>
      _menuItems.value = List<HomeMenuItem>.from(val).obs;

  /// 当前选中菜单
  String get currentSelectMenu => _currentSelectMenu.value;
  set currentSelectMenu(String val) => _currentSelectMenu.value = val;

  /// 状态
  bool get isOnline => _isOnline.value;
  set isOnline(bool val) => _isOnline.value = val;
}
