upload_view_model.dart 633 B

12345678910111213141516171819202122
  1. import 'package:eitc_erm_dental_flutter/funcs.dart';
  2. import 'package:eitc_erm_dental_flutter/http/api_service.dart';
  3. import 'package:eitc_erm_dental_flutter/http/http.dart';
  4. import 'package:riverpod_annotation/riverpod_annotation.dart';
  5. import '../../../entity/clinic_info.dart';
  6. part 'upload_view_model.g.dart';
  7. ///医院列表
  8. @riverpod
  9. Future<List<ClinicInfo>> clinicList(ClinicListRef ref) async {
  10. try {
  11. List<ClinicInfo>? list = await Http.instance
  12. .request(ApiService(Http.instance.dio).getClinicList());
  13. return list ?? [];
  14. } catch (e) {
  15. loge("获取医院列表异常", error: e);
  16. }
  17. return [];
  18. }