From c7ed2f16c1b2e323619356f291e8ab6dd68adaae Mon Sep 17 00:00:00 2001 From: JulianAlcala Date: Thu, 23 Apr 2026 02:06:43 +0200 Subject: [PATCH] feat(ui): use pill style for offline and technical error dialogs --- .../lib/src/errors/error_dialogs.dart | 38 ++++--------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/packages/sf_shared/lib/src/errors/error_dialogs.dart b/packages/sf_shared/lib/src/errors/error_dialogs.dart index a088adf4..84d8df19 100644 --- a/packages/sf_shared/lib/src/errors/error_dialogs.dart +++ b/packages/sf_shared/lib/src/errors/error_dialogs.dart @@ -1,40 +1,16 @@ -import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:sf_localizations/sf_localizations.dart'; +import 'feedback_dialogs.dart'; + Future showOfflineDialog( BuildContext context, { VoidCallback? onRetry, -}) { - return showDialog( - context: context, - builder: (ctx) => AlertDialog( - title: Text(ctx.translate(I18n.errorOfflineTitle)), - content: Text(ctx.translate(I18n.errorOfflineMessage)), - actions: [ - TextButton( - onPressed: () { - Navigator.of(ctx).pop(); - onRetry?.call(); - }, - child: Text(ctx.translate(I18n.errorOfflineRetry)), - ), - ], - ), - ); +}) async { + await showErrorDialog(context, I18n.errorOfflineMessage); + onRetry?.call(); } Future showTechnicalErrorDialog(BuildContext context) { - return showDialog( - context: context, - builder: (ctx) => AlertDialog( - title: Text(ctx.translate(I18n.errorTechnicalTitle)), - content: Text(ctx.translate(I18n.errorTechnicalMessage)), - actions: [ - TextButton( - onPressed: () => Navigator.of(ctx).pop(), - child: Text(ctx.translate(I18n.accept)), - ), - ], - ), - ); + return showErrorDialog(context, I18n.errorTechnicalMessage); }