config.dart 934 B

12345678910111213141516171819202122232425262728293031
  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. class Config {
  6. static SharedPreferences pref;
  7. static bool isLogin = false;
  8. // 通过这个来控制全局环境变量
  9. static Api apiClient;
  10. static initConfig() async {
  11. if (pref == null) {
  12. pref = await SharedPreferences.getInstance();
  13. }
  14. if (apiClient == null) {
  15. apiClient = RemoteApi();
  16. }
  17. }
  18. }
  19. class ThemeColor {
  20. static const Color appBg = Color(0xfff5f6f7);
  21. static const Color appBarTopBg = Color(0xff00C2FD);
  22. static const Color appBarBottomBg = Color(0xff00C2FD);
  23. static const Color hintTextColor = Color(0xff333333);
  24. static const Color subTextColor = Color(0xff999999);
  25. static const Color starColor = Color(0xFFFFA516);
  26. static const Color loignColor = Color(0xFFFE976A);
  27. }