feat:增加消息记录功能

This commit is contained in:
2026-06-19 21:10:03 +08:00
parent bb1160ad18
commit 5d12377606
23 changed files with 458 additions and 170 deletions

23
lib/utils/sp_utils.dart Normal file
View File

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