import 'package:betting/data/base_service/api_response.dart';
import 'package:betting/data/model/res/infor_team/infor_team.dart';
import 'package:betting/data/model/res/matches/matches.dart';
import 'package:betting/data/repository/matches/matches_repo.dart';
import 'package:get/get.dart';


class EstadiMatchesController extends GetxController{

  var itemMatches = Matches().obs;
  MatchesRepo matchesRepo = MatchesRepo();
  var infoTeam = InforTeam().obs;
  var h2hTeam = H2h().obs;

  @override
  void onInit() {
    var data = Get.arguments;
    if(data!= null){
      itemMatches.value = data;
    }
    getInfoMatches(itemMatches.value.sId!);


    super.onInit();
  }

  getInfoMatches(String matchesId) async {
    await matchesRepo.inforMatches(matchesId).then(
          (value) {
        if (value.state == Status.SUCCESS) {
          infoTeam.value = value.object!;

        }
      },
    );
  }

}