import 'package:fis_jsonrpc/rpc.dart'; import 'package:vitalapp/managers/interfaces/dictionary.dart'; import 'package:vitalapp/rpc.dart'; import 'package:vitalapp/store/store.dart'; class DictionaryManager implements IDictionaryManager { DictionaryManager(); @override Future?> getDictionaryNameAndUnitByKeysAsync( List keys) async { var request = GetDictionaryNameAndUnitByKeysRequest( keys: keys, token: Store.user.token, ); var result = await rpc.vitalDictionary.getDictionaryNameAndUnitByKeysAsync(request); return result; } ///根据key返回单位 @override String getUnitByKey(String key) { switch (key) { case 'Temperature': return "°C"; case 'sugar': return 'mmol/l'; case 'Pulse_Frequency': return 'bpm'; case 'Spo2': return '%'; case 'Height': return 'cm'; case 'Weight': return 'kg'; case 'Bmi': return 'kg/m²'; case "HEART": case "Pulse_Beat": return 'bpm'; case 'Sbp': case 'Dbp': return 'mmgh'; } return ''; } }