front dev update
This commit is contained in:
49
frontend/pshared/lib/config/common_dev.dart
Normal file
49
frontend/pshared/lib/config/common_dev.dart
Normal file
@@ -0,0 +1,49 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
class CommonConstants {
|
||||
static String apiProto = 'http';
|
||||
static String apiHost = 'localhost:8080';
|
||||
static String apiEndpoint = '/api/v1';
|
||||
static String amplitudeSecret = 'c3d75b3e2520d708440acbb16b923e79';
|
||||
static String amplitudeServerZone = 'EU';
|
||||
static String posthogApiKey = 'phc_lVhbruaZpxiQxppHBJpL36ARnPlkqbCewv6cauoceTN';
|
||||
static String posthogHost = 'https://eu.i.posthog.com';
|
||||
static Locale defaultLocale = const Locale('en');
|
||||
static String defaultCurrency = 'EUR';
|
||||
static int defaultDimensionLength = 500;
|
||||
static String clientId = '';
|
||||
static String wsProto = 'ws';
|
||||
static String wsEndpoint = '/ws';
|
||||
static Color themeColor = Color.fromARGB(255, 80, 63, 224);
|
||||
static String nilObjectRef = '000000000000000000000000';
|
||||
|
||||
// Public getters for shared properties
|
||||
static String get serviceUrl => '$apiProto://$apiHost';
|
||||
static String get apiUrl => '$serviceUrl$apiEndpoint';
|
||||
static String get wsUrl => '$wsProto://$apiHost$apiEndpoint$wsEndpoint';
|
||||
static const String accessTokenStorageKey = 'access_token';
|
||||
static const String refreshTokenStorageKey = 'refresh_token';
|
||||
static const String currentOrgKey = 'current_org';
|
||||
static const String deviceIdStorageKey = 'device_id';
|
||||
|
||||
// Method to apply the configuration, called by platform-specific implementations
|
||||
static void applyConfiguration(Map<String, dynamic> configJson) {
|
||||
apiProto = configJson['apiProto'] ?? apiProto;
|
||||
apiHost = configJson['apiHost'] ?? apiHost;
|
||||
apiEndpoint = configJson['apiEndpoint'] ?? apiEndpoint;
|
||||
amplitudeSecret = configJson['amplitudeSecret'] ?? amplitudeSecret;
|
||||
amplitudeServerZone = configJson['amplitudeServerZone'] ?? amplitudeServerZone;
|
||||
posthogApiKey = configJson['posthogApiKey'] ?? posthogApiKey;
|
||||
posthogHost = configJson['posthogHost'] ?? posthogHost;
|
||||
defaultLocale = Locale(configJson['defaultLocale'] ?? defaultLocale.languageCode);
|
||||
defaultCurrency = configJson['defaultCurrency'] ?? defaultCurrency;
|
||||
wsProto = configJson['wsProto'] ?? wsProto;
|
||||
wsEndpoint = configJson['wsEndpoint'] ?? wsEndpoint;
|
||||
defaultDimensionLength = configJson['defaultDimensionLength'] ?? defaultDimensionLength;
|
||||
clientId = configJson['clientId'] ?? clientId;
|
||||
if (configJson.containsKey('themeColor')) {
|
||||
themeColor = Color(int.parse(configJson['themeColor']));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user