getIntegration static method

Future<IntegrationResponse> getIntegration(
  1. String integrationId
)

Implementation

static Future<IntegrationResponse> getIntegration(
    String integrationId) async {
  //Request to get the integration Json data
  var response = await ApiManager.get(
      '${SocketUrls.baseBrokerEndpoint}integrations/$integrationId');
  final pref = await SharedPreferences.getInstance();
  //Saved into shared preferences as IntegrationId
  pref.setString(IdentifierType.integrationId.name, integrationId);

  // if (kDebugMode) {
  //   print(IntegrationResponse.fromJson(jsonDecode(response.body)));
  // }

  return IntegrationResponse.fromJson(jsonDecode(response.body));
}