simplified code across the app and consolidated duplicated helpers

This commit is contained in:
2026-09-27 17:29:54 +02:00
parent 3e856d0b1c
commit ee1240f71a
155 changed files with 1772 additions and 2546 deletions
+12
View File
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import '../api/errors/error_mapper.dart';
import '../utils/clipboard_helper.dart';
class InfoDialog {
@@ -40,4 +41,15 @@ class InfoDialog {
},
);
}
/// Error dialog with the user-facing [message] (default: mapped from
/// [error]) plus the technical details when they add information.
static void showError(BuildContext context, Object error, {String? message}) {
final text = message ?? errorToUserMessage(error);
final details = errorToTechnicalDetails(error);
final body = details != null && details != text
? '$text\n\n$details'
: text;
show(context, body, copyable: true, title: 'Fehler');
}
}