|
@@ -40,7 +40,6 @@ class NewConfigurableCard extends StatefulWidget {
|
|
|
final String? examData;
|
|
|
|
|
|
final FEventHandler<bool>? onSubmitEvent;
|
|
|
- final FEventHandler<bool>? onCloseEvent;
|
|
|
const NewConfigurableCard({
|
|
|
super.key,
|
|
|
required this.cardKey,
|
|
@@ -49,7 +48,6 @@ class NewConfigurableCard extends StatefulWidget {
|
|
|
this.patientCode,
|
|
|
this.examData,
|
|
|
this.onSubmitEvent,
|
|
|
- this.onCloseEvent,
|
|
|
});
|
|
|
|
|
|
@override
|
|
@@ -100,25 +98,19 @@ class NewConfigurableFormState extends State<NewConfigurableCard> {
|
|
|
}
|
|
|
});
|
|
|
widget.onSubmitEvent?.addListener(submitEvent);
|
|
|
- widget.onCloseEvent?.addListener(submitEvent);
|
|
|
}
|
|
|
|
|
|
@override
|
|
|
void dispose() {
|
|
|
super.dispose();
|
|
|
widget.onSubmitEvent?.removeListener(submitEvent);
|
|
|
- widget.onCloseEvent?.removeListener(submitEvent);
|
|
|
}
|
|
|
|
|
|
void submitEvent(sender, e) {
|
|
|
if (e) {
|
|
|
- submit();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- void closeEvent(sender, e) {
|
|
|
- if (e) {
|
|
|
- submit();
|
|
|
+ if (formValue.isNotEmpty) {
|
|
|
+ submit();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|