import 'package:shared_preferences/shared_preferences.dart'; class Preferences { static const languageCodeKey = "languageCodeKey"; static const isFinishOnBoardingKey = "isFinishOnBoardingKey"; static const foodDeliveryType = "foodDeliveryType"; static const themKey = "themKey"; static const payFastSettings = "payFastSettings"; static const mercadoPago = "MercadoPago"; static const paypalSettings = "paypalSettings"; static const stripeSettings = "stripeSettings"; static const flutterWave = "flutterWave"; static const payStack = "payStack"; static const paytmSettings = "PaytmSettings"; static const walletSettings = "walletSettings"; static const razorpaySettings = "razorpaySettings"; static const midTransSettings = "midTransSettings"; static const orangeMoneySettings = "orangeMoneySettings"; static const xenditSettings = "xenditSettings"; static const codSettings = "CODSettings"; static const orderRingtone = "audioSound"; static late SharedPreferences pref; static Future initPref() async { pref = await SharedPreferences.getInstance(); } static bool getBoolean(String key) { return pref.getBool(key) ?? false; } static Future setBoolean(String key, bool value) async { await pref.setBool(key, value); } static String getString(String key, {String? defaultValue}) { return pref.getString(key) ?? defaultValue ?? ""; } static Future setString(String key, String value) async { await pref.setString(key, value); } static int getInt(String key) { return pref.getInt(key) ?? 0; } static Future setInt(String key, int value) async { await pref.setInt(key, value); } static Future clearSharPreference() async { await pref.clear(); } static Future clearKeyData(String key) async { await pref.remove(key); } }