feat: complete leave approval MVP
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class RuntimeConfig {
|
||||
static const _configuredApiBaseUrl = String.fromEnvironment(
|
||||
'AIOA_API_BASE_URL',
|
||||
);
|
||||
static const _configuredOidcIssuer = String.fromEnvironment(
|
||||
'AIOA_OIDC_ISSUER',
|
||||
);
|
||||
|
||||
static String get apiBaseUrl => _configuredApiBaseUrl.isNotEmpty
|
||||
? _configuredApiBaseUrl
|
||||
: '${_localOrigin(8080)}/api/v1';
|
||||
|
||||
static String get oidcIssuer => _configuredOidcIssuer.isNotEmpty
|
||||
? _configuredOidcIssuer
|
||||
: 'http://localhost:8081/realms/aioa';
|
||||
|
||||
static String _localOrigin(int port) {
|
||||
final host = defaultTargetPlatform == TargetPlatform.android
|
||||
? '10.0.2.2'
|
||||
: '127.0.0.1';
|
||||
return 'http://$host:$port';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user