import 'package:betting/data/model/res/matches/matches.dart';
import 'package:betting/view/mobile/scores/football/detail_tournament/matches/matches_football_controller.dart';
import 'package:get/get.dart';

class FixtureTournamentsController extends GetxController {
  late final matchFootballController;
  Rxn<ItemsMatches> itemMatches = Rxn(ItemsMatches());
  List fixturesData = [
    {
      'SUNDAY 23 JULY': [
        {
          'time': '06:00',
          'logoTeamFavourite':
          'https://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/FC_Bayern_M%C3%BCnchen_logo_%282017%29.svg/1200px-FC_Bayern_M%C3%BCnchen_logo_%282017%29.svg.png',
          'teamNameFavourite': 'Bayern Munich',
          'logoTeamCompetitor':
          'https://upload.wikimedia.org/wikipedia/vi/thumb/0/0c/Liverpool_FC.svg/1200px-Liverpool_FC.svg.png',
          'teamNameCompetitor': 'Liverpool',
          'isFavourite': true
        },
        {
          'time': '06:00',
          'logoTeamFavourite':
          'https://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/FC_Bayern_M%C3%BCnchen_logo_%282017%29.svg/1200px-FC_Bayern_M%C3%BCnchen_logo_%282017%29.svg.png',
          'teamNameFavourite': 'Bayern Munich',
          'logoTeamCompetitor':
          'https://upload.wikimedia.org/wikipedia/vi/thumb/0/0c/Liverpool_FC.svg/1200px-Liverpool_FC.svg.png',
          'teamNameCompetitor': 'Liverpool',
          'isFavourite': true
        },
        {
          'time': '06:00',
          'logoTeamFavourite':
          'https://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/FC_Bayern_M%C3%BCnchen_logo_%282017%29.svg/1200px-FC_Bayern_M%C3%BCnchen_logo_%282017%29.svg.png',
          'teamNameFavourite': 'Bayern Munich',
          'logoTeamCompetitor':
          'https://upload.wikimedia.org/wikipedia/vi/thumb/0/0c/Liverpool_FC.svg/1200px-Liverpool_FC.svg.png',
          'teamNameCompetitor': 'Liverpool',
          'isFavourite': true
        }
      ],
      'THURSDAY 27 JULY': [
        {
          'time': '06:00',
          'logoTeamFavourite':
          'https://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/FC_Bayern_M%C3%BCnchen_logo_%282017%29.svg/1200px-FC_Bayern_M%C3%BCnchen_logo_%282017%29.svg.png',
          'teamNameFavourite': 'Bayern Munich',
          'logoTeamCompetitor':
          'https://upload.wikimedia.org/wikipedia/vi/thumb/0/0c/Liverpool_FC.svg/1200px-Liverpool_FC.svg.png',
          'teamNameCompetitor': 'Liverpool',
          'isFavourite': true
        },
        {
          'time': '06:00',
          'logoTeamFavourite':
          'https://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/FC_Bayern_M%C3%BCnchen_logo_%282017%29.svg/1200px-FC_Bayern_M%C3%BCnchen_logo_%282017%29.svg.png',
          'teamNameFavourite': 'Bayern Munich',
          'logoTeamCompetitor':
          'https://upload.wikimedia.org/wikipedia/vi/thumb/0/0c/Liverpool_FC.svg/1200px-Liverpool_FC.svg.png',
          'teamNameCompetitor': 'Liverpool',
          'isFavourite': true
        },
        {
          'time': '06:00',
          'logoTeamFavourite':
          'https://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/FC_Bayern_M%C3%BCnchen_logo_%282017%29.svg/1200px-FC_Bayern_M%C3%BCnchen_logo_%282017%29.svg.png',
          'teamNameFavourite': 'Bayern Munich',
          'logoTeamCompetitor':
          'https://upload.wikimedia.org/wikipedia/vi/thumb/0/0c/Liverpool_FC.svg/1200px-Liverpool_FC.svg.png',
          'teamNameCompetitor': 'Liverpool',
          'isFavourite': true
        }
      ]
    }
  ];

  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();

    if (Get.isRegistered<MatchesFootballController>()) {
      matchFootballController = Get.find<MatchesFootballController>();
    } else {
      matchFootballController = Get.put(MatchesFootballController());
    }

    itemMatches.value = Get.arguments;
    matchFootballController.getListScheduleByCompetitionId(itemMatches.value!.sId!);
    print('id itemMatch: ${itemMatches.value!.sId}');
  }
}