import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/imei_details.dart';
import 'package:doctor_app_flutter/core/service/auth_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';

class IMEIViewModel extends BaseViewModel {
  AuthService _authService = locator<AuthService>();
  List<GetIMEIDetailsModel> get imeiDetails => _authService.dashboardItemsList;

  Future selectDeviceImei(imei) async {
    setState(ViewState.Busy);
    await _authService.selectDeviceImei(imei);
    if (_authService.hasError) {
      error = _authService.error;
      setState(ViewState.Error);
    } else
      setState(ViewState.Idle);
  }
}
