import 'package:betting/data/base_service/api_response.dart';
import 'package:betting/data/model/res/teams/teams.dart';
import 'package:get/get.dart';

import '../../../../data/repository/teams/team_repo.dart';

class NotificationSettingsController extends GetxController {
  var listTitle = ["Football"];
  var indexClick = 0.obs;
  var listNotificationMatch = <bool>[].obs;
  var listNotificationNews = <bool>[].obs;
  var listTeamFollow = <ItemTeams>[].obs;
  final TeamsRepo teamsRepo = TeamsRepo();
  @override
  void onInit() async {
    var listTeam = Get.arguments;
    if (listTeam != null && listTeam.isNotEmpty) {
      listTeamFollow.value = listTeam;
    }
    for(int i = 0 ; i <listTeamFollow.length;i++){
      listNotificationMatch.add(true);
      listNotificationNews.add(true);
    }
    super.onInit();
  }


  addTeamFollow()async{
    await teamsRepo.addTeamFollow(listTeamFollow, listNotificationMatch, listNotificationNews).then((value) {
      if (value.state == Status.SUCCESS) {
      }
    });
  }

}



