Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.4 kB
1
Indexable
Never
import 'package:shared_preferences/shared_preferences.dart';

class SharedPref {
  static const TOKEN = "token";
  static const NAME = "FIRST_NAME";
  static const DISTRIBUTOR_NAME = "DISTRIBUTOR_FIRST_NAME";
  static const Distributor_ID = "Distributor_ID";
  static const SALES_EXECUTIVE_ID = "SALES_EXECUTIVE_ID";
  static const profile_pic = "profile_pic";
  static const PURCHAGESED_TRACKER = "PURCHAGESED_TRACKER";
  static const PURCHAGESED_TRACKER_DETAIL = "PURCHAGESED_TRACKER_DETAIL";
  static const AGE = "AGE";
  static const DESCRIPTION = "DESCRIPTION";
  static const TYPE = "TYPE";
    static const Phone = "Phone";
  static const DISTRBUTOR_Phone = "DISTRIBUTOR_Phone";
  static const loginstatus = "loginstatus";

  static SharedPreferences? prefs;

  static clearSharePref() async {
    prefs = await SharedPreferences.getInstance();
    prefs?.setString(TOKEN, '');
    prefs?.setString(NAME, '');
    prefs?.setString(TYPE, '');
    prefs?.setString(Distributor_ID, '');
    prefs?.setInt(SALES_EXECUTIVE_ID, 0);
    prefs?.setString(profile_pic, '');
    prefs?.setString(AGE, '');
    prefs?.setString(DESCRIPTION, '');
    prefs?.setString(Phone, '');
    prefs?.setString(DISTRIBUTOR_NAME, '');
    prefs?.setString(DISTRBUTOR_Phone, '');
    prefs?.setString(PURCHAGESED_TRACKER, '');
    prefs?.setString(PURCHAGESED_TRACKER_DETAIL, '');
    prefs?.setString(loginstatus, '');
  }
}