MorphrCloudClient constructor

MorphrCloudClient({
  1. required String baseUrl,
  2. String? accessToken,
  3. String? refreshToken,
  4. void onTokenRefreshed(
    1. String accessToken,
    2. String refreshToken
    )?,
  5. Duration timeout = const Duration(seconds: 30),
})

Creates a new MorphrCloudClient instance with JWT authentication.

The baseUrl parameter is the base URL of the Morphr Cloud API. The onTokenRefreshed callback is called when the access token is refreshed.

Implementation

MorphrCloudClient({
  required this.baseUrl,
  this.accessToken,
  this.refreshToken,
  this.onTokenRefreshed,
  this.timeout = const Duration(seconds: 30),
}) : authMethod = MorphrAuthMethod.jwt,
     _clientId = null,
     _clientSecret = null;