Implementation
onLongPressDataTableRow(BuildContext context, {DiseaseObservation? diseaseObservation}) async {
if (diseaseObservation == null) {
return;
}
LogManager().addLog("${diseaseObservation.createdAt}(${diseaseObservation.id})의 질병관찰 삭제", action: LogConstants.graphRowTap, screen: runtimeType.toString());
EventService().eventBus.fire(
PopupEvent(
type: PopupType.confirm,
action: PopupAction.show,
data: {"title": StringConstants.popupDiseaseObservationDeleteConfirmTitle, "content": StringConstants.popupDiseaseObservationDeleteConfirmContent},
onTapYes: () async {
EventService().eventBus.fire(PopupEvent(type: PopupType.loading, action: PopupAction.show));
await ApiService().deleteDiseaseObservations(diseaseObservation: diseaseObservation);
EventService().eventBus.fire(
PopupEvent(
type: PopupType.alert,
action: PopupAction.show,
data: {"title": StringConstants.popupDiseaseObservationDeleteCompleteTitle, "content": StringConstants.popupDiseaseObservationDeleteCompleteContent},
onClose: () async {
Navigator.of(context, rootNavigator: true).popUntil((route) => route.settings.name != PopupScreen.routeName);
await fetchData(context);
},
),
);
},
),
);
// Navigator.of(context, rootNavigator: true).pushNamed(
// DiseaseObservationCreateScreen.routeName,
// arguments: DiseaseObservationCreateScreenArguments(
// diseaseObservation: diseaseObservation,
// inputMode: inputMode,
// ),
// );
}