76f266645d
含 Phase 1.1 IM seq 排序、断线重连、多端已读同步与微信式语音转文字 UI。 排除 node_modules、构建产物、安装包与 .env 密钥。 Co-authored-by: Cursor <cursoragent@cursor.com>
20 lines
545 B
Dart
20 lines
545 B
Dart
import 'package:package_info_plus/package_info_plus.dart';
|
|
|
|
import 'app_config.dart';
|
|
|
|
/// 运行时从安装包读取的真实版本,避免 OTA 误判。
|
|
class AppRuntime {
|
|
AppRuntime._();
|
|
|
|
static String version = AppConfig.version;
|
|
static int build = AppConfig.build;
|
|
|
|
static Future<void> load() async {
|
|
try {
|
|
final info = await PackageInfo.fromPlatform();
|
|
version = info.version.isNotEmpty ? info.version : AppConfig.version;
|
|
build = int.tryParse(info.buildNumber) ?? AppConfig.build;
|
|
} catch (_) {}
|
|
}
|
|
}
|