config.dart 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_tracker/dio/api.dart';
  3. import 'package:flutter_tracker/dio/remote_api.dart';
  4. import 'package:shared_preferences/shared_preferences.dart';
  5. /// Description:
  6. /// Time : 2021年12月03日 Friday
  7. /// Author : liuyuqi.gov@msncn
  8. class Config {
  9. static SharedPreferences pref;
  10. static bool isLogin = false;
  11. // 通过这个来控制全局环境变量
  12. static Api apiClient;
  13. static initConfig() async {
  14. if (pref == null) {
  15. pref = await SharedPreferences.getInstance();
  16. }
  17. if (apiClient == null) {
  18. apiClient = RemoteApi();
  19. }
  20. }
  21. }
  22. class ThemeColor {
  23. static const Color appBg = Color(0xfff5f6f7);
  24. static const Color appBarTopBg = Color(0xff00C2FD);
  25. static const Color appBarBottomBg = Color(0xff00C2FD);
  26. static const Color hintTextColor = Color(0xff333333);
  27. static const Color subTextColor = Color(0xff999999);
  28. static const Color starColor = Color(0xFFFFA516);
  29. static const Color loignColor = Color(0xFFFE976A);
  30. }