From e8a8f8921dbb6c6fdbc688c2da6b3ad09abd2de8 Mon Sep 17 00:00:00 2001 From: Krille Date: Wed, 29 Nov 2023 15:31:25 +0100 Subject: [PATCH] fix: Error widget spamming with dialogs --- lib/widgets/error_widget.dart | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/widgets/error_widget.dart b/lib/widgets/error_widget.dart index 8606c760..e21e5e4e 100644 --- a/lib/widgets/error_widget.dart +++ b/lib/widgets/error_widget.dart @@ -11,10 +11,15 @@ class FluffyChatErrorWidget extends StatefulWidget { } class _FluffyChatErrorWidgetState extends State { + static final Set knownExceptions = {}; @override void initState() { super.initState(); + if (knownExceptions.contains(widget.details.exception.toString())) { + return; + } + knownExceptions.add(widget.details.exception.toString()); WidgetsBinding.instance.addPostFrameCallback((_) { ErrorReporter(context, 'Error Widget').onErrorCallback( widget.details.exception, @@ -32,15 +37,6 @@ class _FluffyChatErrorWidgetState extends State { child: Material( color: Colors.white.withOpacity(0.9), borderRadius: BorderRadius.circular(8), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - '😲 Oh no! Something is broken 😲\n${widget.details.exception}', - maxLines: 5, - textAlign: TextAlign.center, - style: const TextStyle(color: Colors.black), - ), - ), ), ), ),