//页面状态 enum ViewState { loading, // 加载中 success, // 加载成功 empty, // 空数据 error, // 错误 } enum SplashType { normal, // 正常 signin, // 登录 signup, // 注册 google, // 谷歌登录 apple, // 苹果登录 facebook, // 脸书登录 logout, // 退出登录 } enum RegisterMode { auto(1, 'Auto'), manual(2, 'Manual'), buy(3, 'Buy'), gen(4, 'Gen'); final int value; final String label; const RegisterMode(this.value, this.label); } enum AccountType { activate, // 激活 changePassword, // 修改密码 } enum BannerAction { notice, // 弹窗通知 page, // 路由跳转 urlOut, // 网页外部跳转 urlIn, // 网页内部跳转 deepLink, // scheme跳转 openPkg, // 打开app } enum LogLevel { info, error, warn, debug, verbose } enum FirebaseEvent { launch, launchCache, launchSuccess, launchCacheSuccess, register, login, logout, deleteAccount, startBoost, cancelBoost, errorBoost, stopBoost, subscribe, restore, } enum LogModule { NM_Metrics, //游戏指标 NM_Log, // core es 日志 NM_BoostResult, // 加速结果 NM_PeekLog, // 探针日志 NM_ApiLaunchLog, // launch接口报错 NM_ApiRouterLog, // router接口报错 NM_ApiOtherLog, // 其他接口报错 } enum ConnectionState { disconnected, // 默认断开状态 connecting, // 连接中状态 connected, // 连接成功状态 error, // 连接错误状态 } enum MemberLevel { guest(1, 'Guest'), normal(2, 'Normal'); final int level; final String label; const MemberLevel(this.level, this.label); // 从 int 值获取枚举 static MemberLevel? fromLevel(int? level) { if (level == null) return null; return MemberLevel.values.firstWhere( (e) => e.level == level, orElse: () => MemberLevel.guest, ); } } enum VpnStatus { idle(0, '空闲状态'), // 空闲状态 connecting(1, '连接中状态'), // 连接中状态 connected(2, '连接成功状态'), // 连接成功状态 error(3, '连接错误状态'); // 连接错误状态 final int value; final String label; const VpnStatus(this.value, this.label); static VpnStatus fromValue(int value) { return VpnStatus.values.firstWhere( (e) => e.value == value, orElse: () => VpnStatus.idle, ); } }