feat(ui): use pill style for offline and technical error dialogs
This commit is contained in:
@@ -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<void> showOfflineDialog(
|
||||
BuildContext context, {
|
||||
VoidCallback? onRetry,
|
||||
}) {
|
||||
return showDialog<void>(
|
||||
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<void> showTechnicalErrorDialog(BuildContext context) {
|
||||
return showDialog<void>(
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user