import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart';
import 'package:diplomaticquarterapp/core/model/weahter/weather_model.dart';

import 'package:diplomaticquarterapp/core/service/er/er_service.dart';
import 'package:diplomaticquarterapp/core/service/weather_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart';

import '../../../locator.dart';

class WeatherViewModel extends BaseViewModel {
  WeatherService _weatherService = locator<WeatherService>();
  List<GetCityInfoList> get weatherIndicatorData =>
      _weatherService.weatherIndicatorData;
  getWeatherData() async {
    setState(ViewState.Busy);

    // if (id != null && projectID != null) {
    //   await _erService.getProjectAvgERWaitingTimeOrders(
    //       id: id, projectID: projectID);
    // } else {
    await _weatherService.getWeatherData();
    // }
    if (_weatherService.hasError) {
      error = _weatherService.error;
      setState(ViewState.Error);
    } else
      setState(ViewState.Idle);
  }
}
