import 'package:fis_jsonrpc/rpc.dart'; import 'package:vitalapp/rpc.dart'; import 'package:vitalapp/store/store.dart'; import 'interfaces/label.dart'; import 'package:fis_common/logger/logger.dart'; class LabelManager implements ILabelManager { @override Future?> getLabelListByKey(String key) async { try { final result = await rpc.label.getLabelListByKeyAsync( GetLabelListByKeyRequest(key: key, token: Store.user.token), ); return result; } catch (e) { logger.e("LabelManager get labels by key-$key error.", e); return null; } } @override Future> getNormalCrowdLabels() async { return (await getLabelListByKey("RQFL")) ?? []; } @override Future> getDiseaseCrowdLabels() async { return (await getLabelListByKey("CJJB")) ?? []; } @override Future> getSpecialCareCrowdLabels() async { return (await getLabelListByKey("TSZG")) ?? []; } }