initialize static method

void initialize({
  1. String? baseUrl,
  2. String? gatewayBaseUrl,
  3. String? apiKey,
  4. TsdtechThemeData? theme,
  5. TsdtechLocale locale = TsdtechLocale.pt,
  6. Environment? stage,
})

Initializes the global TSDTech UI configuration.

Parameters:

  • baseUrl: Required. Backend SPA base URL.
  • gatewayBaseUrl: Optional. Payment gateway URL.
  • apiKey: Optional. API key for authenticated requests.
  • theme: Optional. Custom TsdtechThemeData. Defaults to TsdtechThemeData.light.
  • locale: Optional. UI locale. Defaults to TsdtechLocale.pt.

Implementation

static void initialize({
  String? baseUrl,
  String? gatewayBaseUrl,
  String? apiKey,
  TsdtechThemeData? theme,
  TsdtechLocale locale = TsdtechLocale.pt,
  Environment? stage,
}) {
  // assert(baseUrl.isNotEmpty, 'baseUrl must not be empty.');
  _instance = TsdtechUiConfig._()
    ..baseUrl = baseUrl
    ..gatewayBaseUrl = gatewayBaseUrl
    ..apiKey = apiKey
    ..theme = theme ?? TsdtechThemeData.light()
    ..locale = locale
    ..stage = stage;
}