initialize static method
void
initialize({
- required String baseUrl,
- String? gatewayBaseUrl,
- String? gatewayApiKey,
- TsdtechThemeData? theme,
- TsdtechLocale locale = TsdtechLocale.pt,
- Environment? stage,
Implementation
static void initialize({
required String baseUrl, // Obrigatório para a API principal
String? gatewayBaseUrl,
String? gatewayApiKey,
TsdtechThemeData? theme, // Opcional para quem quiser customizar a UI
TsdtechLocale locale = TsdtechLocale.pt,
Environment?
stage, // Opcional para quem quiser setar o stage (dev, hml, prod)
}) {
TsdtechUiConfig.initialize(
baseUrl: baseUrl,
gatewayBaseUrl: gatewayBaseUrl,
apiKey: gatewayApiKey,
theme: theme,
locale: locale,
stage:
stage ??
Constants.getStage(), // Usa o stage do argumento ou o default do Constants
);
_instance ??= TsdtechClient._(
gatewayBaseUrl: gatewayBaseUrl,
gatewayApiKey: gatewayApiKey,
stage: stage ?? Constants.getStage(),
);
Constants.setStage(stage ?? Constants.getStage());
}