feat:增加服务器接口模块

This commit is contained in:
2026-06-17 23:40:14 +08:00
parent ddd1c1960e
commit b816cdbc1c
18 changed files with 693 additions and 69 deletions

23
lib/utils/SpUtil.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();
}