MorphrCloudClient class

Client for interacting with the Morphr Cloud API.

Constructors

MorphrCloudClient({required String baseUrl, String? accessToken, String? refreshToken, void onTokenRefreshed(String accessToken, String refreshToken)?, Duration timeout = const Duration(seconds: 30)})
Creates a new MorphrCloudClient instance with JWT authentication.
MorphrCloudClient.withApiKey({required String baseUrl, required String clientId, required String clientSecret, Duration timeout = const Duration(seconds: 30)})
Creates a new MorphrCloudClient instance with API key authentication.
factory

Properties

accessToken ↔ String?
Current access token for JWT authentication.
getter/setter pair
authMethod → MorphrAuthMethod
Authentication method being used
final
baseUrl → String
Base URL of the Morphr Cloud API.
final
hashCode → int
The hash code for this object.
no setterinherited
isAuthenticated → bool
Flag to track if the client is authenticated
no setter
onTokenRefreshed → void Function(String accessToken, String refreshToken)?
Callback that is called when the access token is refreshed.
final
refreshToken ↔ String?
Current refresh token for obtaining a new access token with JWT auth.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
timeout → Duration
Request timeout
final

Methods

get(String endpoint, {bool requiresAuth = true, Map<String, String>? headers, Map<String, String>? queryParams}) → Future<Map<String, dynamic>>
Makes a GET request to the specified endpoint.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
post(String endpoint, {dynamic body, bool requiresAuth = true, Map<String, String>? headers}) → Future<Map<String, dynamic>>
Makes a POST request to the specified endpoint with the given body.
syncDev({required int projectId, String? figmaFileHash}) → Future<Map<String, dynamic>>
Synchronizes a project with the development environment.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited