initData static method

dynamic initData()

Implementation

static initData() async {
  WidgetsFlutterBinding.ensureInitialized();

  String? login = await getStoreValue(FastActions.isLogin());
  FastCache(FastActions.isLogin()).value = login == '1';

  getStoreValue(FastActions.loginInfo()).then((onValue) {
    if (onValue != null) {
      Map data = jsonDecode(onValue);
      userStoreData = data;
      FastCache(FastActions.isLogin()).value = true;
      FastCache(FastActions.token()).value = data['token'];
      if (data["userInfo"] != null) {
        FastCache(FastActions.userId()).value = data["userInfo"]['userId'];
        FastCache(FastActions.loginAccount()).value =
            data["userInfo"]["phone"];
        FastCache(FastActions.userName()).value =
            data["userInfo"]["username"];
      }
    }
  });
}