fetchInitialValues method

Future<void> fetchInitialValues()

Implementation

Future<void> fetchInitialValues() async {
  businessToken = await Utils().getPrefsString(key: PUBLIC_TOKEN_PREF_KEY) ?? "dummy";
  timeout = await Utils().getPrefsInt(key: TIMEOUT_PREF_KEY) ?? 0;
  paymentAmount =
      await Utils().getPrefsDouble(key: PAYMENT_AMOUNT_PREF_KEY) ?? 0;
  style = await getTheme();
  environment =
      await Utils().getPrefsString(key: BUILD_TYPE_PREF_KEY) ?? "Production";
  lang = await getLang();
  subtotal = await Utils().getPrefsDouble(key: SUBTOTAL_PREF_KEY) ?? 0.00;
  tax = await Utils().getPrefsDouble(key: TAX_PREF_KEY) ?? 0.00;
  metadata1 = await Utils().getPrefsString(key: METADATA1_PREF_KEY) ?? "";
  metadata2 = await Utils().getPrefsString(key: METADATA2_PREF_KEY) ?? "";
  newFlow = "YES";
  phoneNumber = await Utils().getPrefsString(key: PHONE_NUMBER_PREF_KEY) ?? "";
  publicToken = businessToken;
  isLoading = false;
  notifyListeners();
}