global.dart 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import 'package:fast/model/model.dart';
  2. import 'package:fast/view/component/fast.dart';
  3. import 'package:flutter/material.dart';
  4. class Global{
  5. static final Global _instance = Global._internal();
  6. RouteObserver<ModalRoute>? routeObserver;
  7. String token = '';
  8. int timeSeconds = 0;//与服务器的时间戳差
  9. bool firstStart = false; //是否从未开始过
  10. bool showDialog = false; //是否存在弹窗,防止同一时间多次弹窗的情况
  11. int fastHour = 16; //断食小时
  12. int fastMinute = 0; //断食分钟
  13. int balance = 0;
  14. bool showLogin = false; //是否显示登录页面
  15. bool allowNotification = false; //是否允许推送
  16. bool thirdLogin = false; //是否允许第三方登录
  17. bool pushEnable = false; //是否强制推送
  18. bool payEnable = false; //是否支持支付
  19. bool showCheckin = false;
  20. double circleWidth = 0.0;
  21. double paintWidth = 0.0;
  22. double progressWidth = 0.0;
  23. double scale = 1.0;
  24. FastBean? currentFast;
  25. UserBean? userBean;
  26. GlobalKey<FastState>? fastKey;
  27. dynamic mainPage;
  28. dynamic homePage;
  29. factory Global(){
  30. return _instance;
  31. }
  32. Global._internal(){
  33. init();
  34. }
  35. void init(){
  36. }
  37. }