getProfileSport static method

Future getProfileSport(
  1. dynamic modelSport
)

Implementation

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