import 'package:voice_buddies/app/api_repository/api_class.dart';
import 'package:voice_buddies/app/utils/all_imports.dart';

class APIFunction {
  Future<dynamic> apiCall({
    required String apiName,
    FormData? params,
    String? token = "",
    bool isLoading = true,
  }) async {
    printAction("params -------->>> ${params!.fields}");
    var response = await HttpUtil(token!, isLoading).post(
      apiName,
      data: params,
    );

    if (response["ResponseCode"] == 26) {
      Utils.forceUpdateDialogue(
        currentVersion: Constants.currentBuildVersion,
      );
    }
    return response;
  }
}
