import 'package:get/get.dart'; ///状态模块构建函数声明 typedef StateModuleBuilder = T Function(); ///持久化状态 abstract class PersistentalbeState { /// 转换为持久存储Json Map toPersistenceJson(); /// 接收持久存储Json Future acceptPersistenceJson(Map map); } ///对持久化的map支撑字典进行相关扩展 extension PersistentPropPickerEx on Map { void pickPersistentProp(String key, void Function(dynamic value) fn) { if (!containsKey(key)) return; final value = this[key]; if (value == null) return; fn(value); } void pickPersistentProps(Map fnMaps) { for (var key in fnMaps.keys) { pickPersistentProp(key, (value) { fnMaps[key]?.call(value); }); } } } abstract class StateModuleBase extends GetxService implements PersistentalbeState {}