feat: enhance error dialogs with delete functionality and improve documentation
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
/// Visar en global dialogruta med ett felmeddelande och en kopieringsknapp.
|
||||
/// Visar en global dialogruta med ett felmeddelande och knappar för kopiera och ta bort.
|
||||
void showGlobalErrorDialog(BuildContext context, String errorMessage) {
|
||||
showDialog(
|
||||
context: context,
|
||||
@@ -17,7 +17,7 @@ void showGlobalErrorDialog(BuildContext context, String errorMessage) {
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: const Text('Stäng'),
|
||||
child: const Text('Ta bort'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
@@ -26,6 +26,7 @@ void showGlobalErrorDialog(BuildContext context, String errorMessage) {
|
||||
child: const Text('Kopiera'),
|
||||
onPressed: () {
|
||||
Clipboard.setData(ClipboardData(text: errorMessage));
|
||||
Navigator.of(context).pop();
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Felmeddelande kopierat!')),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user