import 'package:shared_preferences/shared_preferences.dart'; class SP { static late SharedPreferences prefs; static Future init() async { prefs = await SharedPreferences.getInstance(); } static double getDouble(String key, [double def = 0]) { return prefs.getDouble(key) ?? def; } static Future setDouble(String key, double value) { return prefs.setDouble(key, value); } static String? getString(String key) { return prefs.getString(key); } static Future setString(String key, String value) { return prefs.setString(key, value); } }