import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter/material.dart';
import 'package:smart_hotel_app/models/bo/user_info_bo.dart';
import 'package:smart_hotel_app/views/profile/index/cubit/profile_state.dart';

class ProfileCubit extends Cubit<ProfileState> {
  final UserInfoBO? _userInfo;

  ProfileCubit({UserInfoBO? userInfo})
      : _userInfo = userInfo,
        super(const ProfileState()) {
    initData();
  }

  void initData() {
    emit(state.copyWith(
      username: _userInfo?.phonenumber ?? '',
      welcomeText: '欢迎来到智能酒店',
      menuList: [
        // const MenuItem(icon: Icons.list, title: '设备列表'),
        // const MenuItem(icon: Icons.warning_rounded, title: '告警信息'),
        // const MenuItem(icon: Icons.info_outline, title: '帮助'),
        // const MenuItem(icon: Icons.person_outline, title: '关于'),
        // const MenuItem(icon: Icons.logout, title: '退出登录'),
        // const MenuItem(icon: Icons.logout, title: '注销账号'),
        const MenuItem(icon: 'lib/assets/icon/device_list_bg.png', title: '设备列表'),
        const MenuItem(icon: 'lib/assets/icon/alarm_info_bg.png', title: '告警信息'),
        const MenuItem(icon: 'lib/assets/icon/help_bg.png', title: '帮助'),
        const MenuItem(icon: 'lib/assets/icon/about_bg.png', title: '关于'),
        const MenuItem(icon: 'lib/assets/icon/exit_login_bg.png', title: '退出登录'),
        // const MenuItem(icon: 'lib/assets/icon/logout_account_bg.png', title: '注销账号'),
      ],
    ));
  }
}