favteamfetch method

Future<void> favteamfetch()

Implementation

Future<void> favteamfetch() async {
  if (currentUserAccounts.favoriteteams == null) {
    TeamListResponse response = await service.teamsServices.fetch();
    if (!response.result.status) {
      log(response.result.description);
      favteamfetch();
      return;
    }

    currentUserAccounts.favoriteteams = [];

    for (APITeamList element in response.response!) {
      currentUserAccounts.favoriteteams!.add(
        Team(
          teamID: element.teamId,
          name: element.teamName,
          logo: element.teamLogo.minURL,
        ),
      );
    }
  }
}