detail.dart 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. import 'package:vitalapp/pages/medical_checkup_station/appointment/controller.dart';
  2. import 'package:vitalapp/pages/medical_checkup_station/appointment/state/list.dart';
  3. class AppointmentDetailController {
  4. final state = ListState();
  5. late final AppointmentController appointmentController;
  6. AppointmentDetailController(AppointmentController controller) {
  7. appointmentController = controller;
  8. }
  9. Future<AppointmentModel> getHealthExamBookingAsync(String code) async {
  10. var result = await appointmentController.appointmentManager
  11. .getHealthExamBookingAsync(
  12. code: code,
  13. );
  14. AppointmentModel appointment = AppointmentModel(
  15. appointmentAddress: result?.location ?? '',
  16. appointmentObject: result?.subject,
  17. appointmentDescription: result?.description,
  18. appointmentName: result?.name ?? '',
  19. appointmentStartTime: result?.startDate?.toLocal(),
  20. appointmentEndTime: result?.endDate?.toLocal(),
  21. appointmentCode: result?.code,
  22. appointmentExamItems: result?.examItems,
  23. appointmentUrl: result?.shareUrl,
  24. appointPersons: result?.persons,
  25. );
  26. return appointment;
  27. }
  28. }