import 'package:shared_preferences/shared_preferences.dart'; class SpUtil { static late SharedPreferences _sp; static Future init() async { _sp = await SharedPreferences.getInstance(); } static Future setString(String key, String value) => _sp.setString(key, value); static String? getString(String key) => _sp.getString(key); static Future setInt(String key, int value) => _sp.setInt(key, value); static int? getInt(String key) => _sp.getInt(key); static Future remove(String key) => _sp.remove(key); static Future clear() => _sp.clear(); }