SharedPreference使用 API 說明注意若未設定此頁面會影響以下功能Preference 的功能課表骨架 中的上課提醒課表小工具設定#在 main() 執行 runApp 前執行 Preferences.init() 一定要加 awaitmain.dartimport 'package:ap_common/utils/preferences.dart'; Future<void> main() async { WidgetsFlutterBinding.ensureInitialized(); await Preferences.init(key: Constants.key, iv: Constants.iv); runApp(const MyApp());}`` 金鑰的部分可以另外使用獨立靜態變數儲存 ```dart title='constants.dart'import 'package:encrypt/encrypt.dart'; class Constants { static final key = Key.fromUtf8('<修改成自己的Key>'); static final iv = IV.fromUtf8('<修改成自己的IV Key>');}Copy