achievement crud complete
This commit is contained in:
@ -21,7 +21,7 @@ Future showGenericDialog(dynamic object, BuildContext parentContext) {
|
||||
}
|
||||
|
||||
Future showCrudDialog(String title, String content, BuildContext context,
|
||||
dynamic daoCall, dynamic object) {
|
||||
[Function? callback]) {
|
||||
return showAdaptiveDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) => AlertDialog(
|
||||
@ -35,7 +35,10 @@ Future showCrudDialog(String title, String content, BuildContext context,
|
||||
child: const Text('Cancel'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => {daoCall(object), Navigator.pop(context, 'OK')},
|
||||
onPressed: () => {
|
||||
if (callback != null) {callback()},
|
||||
Navigator.pop(context, 'OK')
|
||||
},
|
||||
child: const Text('OK'),
|
||||
),
|
||||
],
|
||||
@ -44,11 +47,11 @@ Future showCrudDialog(String title, String content, BuildContext context,
|
||||
}
|
||||
|
||||
Future showRemovalDialog(String title, String content, BuildContext context,
|
||||
dynamic dao, dynamic object) {
|
||||
return showCrudDialog(title, content, context, dao.remove, object);
|
||||
[Function? callback]) {
|
||||
return showCrudDialog(title, content, context, callback);
|
||||
}
|
||||
|
||||
Future showUpdateDialog(String title, String content, BuildContext context,
|
||||
dynamic dao, dynamic object) {
|
||||
return showCrudDialog(title, content, context, dao.replace, object);
|
||||
[Function? callback]) {
|
||||
return showCrudDialog(title, content, context, callback);
|
||||
}
|
||||
|
Reference in New Issue
Block a user