26 lines
921 B
Dart
26 lines
921 B
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 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;
|
|
}
|
|
|
|
static String get androidAppKey => _androidAppKey;
|
|
static String get iosAppKey => _iosAppKey;
|
|
static String get androidPushSecret => _androidPushSecret;
|
|
}
|