achievement crud complete

This commit is contained in:
Joshua Burman
2025-01-03 18:20:11 -05:00
parent 2206720810
commit 32826abcea
12 changed files with 293 additions and 212 deletions

View File

@ -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);
}