getDataWallet static method

Future<DataWallet?> getDataWallet()

Implementation

static Future<DataWallet?> getDataWallet() async {
  SharedPreferences pref = await SharedPreferences.getInstance();
  if (pref.getString(keyDataWallet) == null) {
    return null;
  } else {
    if (pref.getString(keyDataWallet) != "") {
      if (pref.getString(keyDataWallet) != "null") {
        // print("apa ini ${pref.getString(Key_profile)}");
        Map dec = json.decode(pref.getString(keyDataWallet)!);
        return DataWallet.fromJson(dec);
      } else {
        return null;
      }
    } else {
      return null;
    }
  }
}