Files
jinzhi/lib/common/config/umeng_config.dart
T
2026-08-24 19:07:31 +08:00

33 lines
1.3 KiB
Dart

// lib/common/config/umeng_config.dart
import 'package:flutter_dotenv/flutter_dotenv.dart';
class UmengConfig {
// Keys loaded from .env file
static String _androidAppKey =
'6a27b1f46f259537c7b616be'; // Default placeholder
static String _iosAppKey = '6a27b24e6f259537c7b617a8'; // Default placeholder
static String _androidPushSecret = 'xxx'; // Default placeholder
static String _androidLoginSecret = '';
static String _iosLoginSecret = '';
static Future<void> load() async {
await dotenv.load(
fileName: "assets/env/.env",
); // Load from packaged asset path
_androidAppKey = dotenv.env['UMENG_ANDROID_APP_KEY'] ?? _androidAppKey;
_iosAppKey = dotenv.env['UMENG_IOS_APP_KEY'] ?? _iosAppKey;
_androidPushSecret =
dotenv.env['UMENG_ANDROID_PUSH_SECRET'] ?? _androidPushSecret;
_androidLoginSecret =
dotenv.env['UMENG_ANDROID_LOGIN_SECRET'] ?? _androidLoginSecret;
_iosLoginSecret = dotenv.env['UMENG_IOS_LOGIN_SECRET'] ?? _iosLoginSecret;
}
static String get androidAppKey => _androidAppKey;
static String get iosAppKey => _iosAppKey;
static String get androidPushSecret => _androidPushSecret;
static String get androidLoginSecret => _androidLoginSecret;
static String get iosLoginSecret => _iosLoginSecret;
}