import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/imei_details.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';

class AuthService extends BaseService {
  List<GetIMEIDetailsModel> _imeiDetails = [];
  List<GetIMEIDetailsModel> get dashboardItemsList => _imeiDetails;

  Future selectDeviceImei(imei) async {
    try {
      // dynamic localRes;
      await baseAppClient.post(SELECT_DEVICE_IMEI,
          onSuccess: (dynamic response, int statusCode) {
        _imeiDetails = [];
        response['List_DoctorDeviceDetails'].forEach((v) {
          _imeiDetails.add(GetIMEIDetailsModel.fromJson(v));
        });
      }, onFailure: (String error, int statusCode) {
        hasError = true;
        super.error = error;
      }, body: {"IMEI": imei, "TokenID": "@dm!n"});
      //return Future.value(localRes);
    } catch (error) {
      hasError = true;
      super.error = error;
    }
  }
}
