add page for aur search

install aur package by button click
This commit is contained in:
2024-01-27 14:51:45 +01:00
parent bb34e56be0
commit c924a151cb
11 changed files with 262 additions and 36 deletions

View File

@ -1,6 +1,12 @@
import 'package:flutter/material.dart';
Future<bool> showDeleteConfirmationDialog(BuildContext context) async {
Future<bool> showConfirmationDialog(
BuildContext context,
String title,
String content,
void Function() successCallback,
void Function()? errorCallback,
) async {
return (await showDialog<bool>(
context: context,
barrierDismissible: false,
@ -17,20 +23,24 @@ Future<bool> showDeleteConfirmationDialog(BuildContext context) async {
),
// Delete confirmation dialog
AlertDialog(
title: Text('Confirm Delete'),
content: Text('Are you sure you want to delete this item?'),
title: Text(title),
content: Text(content),
actions: <Widget>[
TextButton(
onPressed: () {
Navigator.of(context).pop(true);
successCallback();
},
child: Text('Yes, Delete'),
child: const Text('Yes'),
),
TextButton(
onPressed: () {
Navigator.of(context).pop(false); // Dismiss dialog
if (errorCallback != null) {
errorCallback();
}
},
child: Text('Cancel'),
child: const Text('Cancel'),
),
],
),