migration to move achievements to session, prep for achievement and media management
This commit is contained in:
@ -20,8 +20,8 @@ Future showGenericDialog(dynamic object, BuildContext parentContext) {
|
||||
});
|
||||
}
|
||||
|
||||
Future showRemovalDialog(String title, String content, BuildContext context,
|
||||
dynamic dao, dynamic object) {
|
||||
Future showCrudDialog(String title, String content, BuildContext context,
|
||||
dynamic daoCall, dynamic object) {
|
||||
return showAdaptiveDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) => AlertDialog(
|
||||
@ -35,10 +35,20 @@ Future showRemovalDialog(String title, String content, BuildContext context,
|
||||
child: const Text('Cancel'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => {dao.remove(object), Navigator.pop(context, 'OK')},
|
||||
onPressed: () => {daoCall(object), Navigator.pop(context, 'OK')},
|
||||
child: const Text('OK'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future showRemovalDialog(String title, String content, BuildContext context,
|
||||
dynamic dao, dynamic object) {
|
||||
return showCrudDialog(title, content, context, dao.remove, object);
|
||||
}
|
||||
|
||||
Future showUpdateDialog(String title, String content, BuildContext context,
|
||||
dynamic dao, dynamic object) {
|
||||
return showCrudDialog(title, content, context, dao.replace, object);
|
||||
}
|
||||
|
Reference in New Issue
Block a user