Newer
Older
flutterBaseApp / lib / common / common.dart
StephanieGitHub on 9 Feb 2021 1 KB first commit
import 'package:flutter/foundation.dart';

class BaseConstant {
  static const String keyShowGuide = 'show_guide'; // 是否显示导航,无用
  static const String serverAddress =
      "http://rest.apizza.net/mock/cfbb939c147bb6d68372de83af189fee/";
  static const String keyAccount = 'username'; // 用户名
  static const String keyPassword = 'password'; // 密码
  static const String keyUserName = 'user_name'; // 用户名:姓名
  static const String keyUserModel = 'user_model'; // 用户对象
  static const String keyPublicKey = 'public_key'; // 公钥
  static const String keyAppToken = 'token'; // token
  static const String keyReadFormLocal = 'read_local'; // 是否仅读取本地数据

  // 路由常量
  static const String routeMain = 'route_main'; // 主页
  static const String routeLogin = 'route_login'; // 登录页
  static const String routeAddInspection = 'demo'; // demo列表页
  static const String routeSetting = 'route_setting'; // 系统设置页
}

class Constant {
  static const String keyLanguage = 'key_language'; // 语言
  static const int status_success = 200; // 成功状态
  static const int type_sys_update = 1; // 系统更新
  static const int type_refresh_all = 5; //?

  static const String key_theme_color = 'key_theme_color';
  static const String key_guide = 'key_guide';
  static const String key_splash_model = 'key_splash_models';
  static const String key_url = 'key_url';
}

// App配置
class AppConfig {
  static const String appId = 'com.casic.flutter.base'; // appId
  static const String appName = 'flutter框架及示例'; // app名称
  static const String version = '1.0'; // 版本
  static const bool isDebug = kDebugMode;
}

// 网络请求状态
class LoadStatus {
  static const int fail = 500; // 失败
  static const int loading = 0;
  static const int success = 200; // 成功
  static const int empty = 2;
}