init static method
dynamic
init({})
Implementation
static init(
{required String baseUrl,
Map<String, String>? headers,
String? mockMappingsFile,
bool applyMock = false,
bool badCertificateCallbackEnabled = false,
int connectionTimeoutInSeconds = 15}) {
// For HTTP Request
TGRequest.defaultBaseUrl = baseUrl;
TGRequest.defaultHeaders = headers;
// For Mock
TGMockService.applyMock = applyMock;
if (mockMappingsFile != null && applyMock) {
TGMockService.loadMockMappings(mockMappingsFile);
}
// For HTTP Client
TGHttpClient.badCertificateCallbackEnabled = badCertificateCallbackEnabled;
TGHttpClient.connectionTimeoutInSeconds = connectionTimeoutInSeconds;
}