fix(config): release 构建自动使用生产环境

This commit is contained in:
Zhou Weidong committed 2026-10-31 14:00:33 +08:00
1 parent 8ec6df2be5
commit a3ac007759
2 files changed
+23 -5

No files matched your search

+5 -5
View File
@@ -1,5 +1,7 @@
// Author: fruit.com.cn
import 'package:flutter/foundation.dart';
import 'dev_config.dart';
import 'prod_config.dart';
@@ -9,12 +11,10 @@ import 'prod_config.dart';
/// - `dev_config.dart`:[DevConfig](本机联调)
/// - `prod_config.dart`:[ProdConfig](生产)
///
/// 切换环境只改下面这一个布尔值,不用传任何构建参数、也不做网络探测。
/// Debug 使用开发环境,Release 自动使用生产环境,不做网络探测。
abstract final class AppConfig {
/// **环境开关**:true 用开发环境,false 用生产环境。
///
/// 打生产包前必须改成 false;release 构建若仍为 true 会在启动时直接报错。
static const bool useDevConfig = true;
/// **环境开关**:Debug 使用开发环境,Release 使用生产环境。
static const bool useDevConfig = !kReleaseMode;
/// 当前选中的环境地址。
static String get baseUrl =>