update function
Implementation
update(context, XModel model, XDataModel instance) async {
GlobalKey<FormState>? key = GlobalKey<FormState>();
return await showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: model.form(key, instance),
actions: [
TextButton(
onPressed: () {
Navigator.pop(context, model.formValue());
},
child: const Text('Update')),
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: const Text('Cancel')),
],
);
});
}