TF-2928 Show confirm dialog & handle exception when reload browser or loss of connection
This commit is contained in:
@@ -19,6 +19,7 @@ export 'presentation/extensions/map_extensions.dart';
|
||||
export 'domain/exceptions/download_file_exception.dart';
|
||||
export 'data/extensions/options_extensions.dart';
|
||||
export 'domain/exceptions/web_session_exception.dart';
|
||||
export 'domain/exceptions/platform_exception.dart';
|
||||
|
||||
// Utils
|
||||
export 'presentation/utils/theme_utils.dart';
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
class PlatformException with EquatableMixin implements Exception {
|
||||
final String message;
|
||||
|
||||
PlatformException(this.message);
|
||||
|
||||
@override
|
||||
List<Object> get props => [message];
|
||||
}
|
||||
|
||||
class NoSupportPlatformException extends PlatformException {
|
||||
NoSupportPlatformException() : super('This platform is not supported');
|
||||
}
|
||||
@@ -24,18 +24,19 @@ class ConfirmDialogBuilder {
|
||||
double? _radiusButton;
|
||||
EdgeInsetsGeometry? _paddingTitle;
|
||||
EdgeInsets? _paddingContent;
|
||||
EdgeInsets? _paddingButton;
|
||||
EdgeInsetsGeometry? _paddingButton;
|
||||
EdgeInsets? _marginButton;
|
||||
EdgeInsets? _outsideDialogPadding;
|
||||
EdgeInsetsGeometry? _marginIcon;
|
||||
EdgeInsets? _margin;
|
||||
double? _widthDialog;
|
||||
double maxWith;
|
||||
final double maxWith;
|
||||
Alignment? _alignment;
|
||||
Color? _backgroundColor;
|
||||
bool showAsBottomSheet;
|
||||
List<TextSpan>? listTextSpan;
|
||||
int? titleActionButtonMaxLines;
|
||||
bool isArrangeActionButtonsVertical;
|
||||
final bool showAsBottomSheet;
|
||||
final List<TextSpan>? listTextSpan;
|
||||
final int? titleActionButtonMaxLines;
|
||||
final bool isArrangeActionButtonsVertical;
|
||||
|
||||
OnConfirmButtonAction? _onConfirmButtonAction;
|
||||
OnCancelButtonAction? _onCancelButtonAction;
|
||||
@@ -104,10 +105,14 @@ class ConfirmDialogBuilder {
|
||||
_paddingContent = value;
|
||||
}
|
||||
|
||||
void paddingButton(EdgeInsets? value) {
|
||||
void paddingButton(EdgeInsetsGeometry? value) {
|
||||
_paddingButton = value;
|
||||
}
|
||||
|
||||
void marginButton(EdgeInsets? value) {
|
||||
_marginButton = value;
|
||||
}
|
||||
|
||||
void marginIcon(EdgeInsetsGeometry? value) {
|
||||
_marginIcon = value;
|
||||
}
|
||||
@@ -253,7 +258,7 @@ class ConfirmDialogBuilder {
|
||||
]
|
||||
else
|
||||
Padding(
|
||||
padding: _paddingButton ?? const EdgeInsetsDirectional.only(bottom: 16, start: 16, end: 16),
|
||||
padding: _marginButton ?? const EdgeInsetsDirectional.only(bottom: 16, start: 16, end: 16),
|
||||
child: Row(
|
||||
children: [
|
||||
if (_cancelText.isNotEmpty)
|
||||
@@ -297,7 +302,7 @@ class ConfirmDialogBuilder {
|
||||
borderRadius: BorderRadius.circular(radius ?? 8),
|
||||
side: BorderSide(width: 0, color: bgColor ?? AppColor.colorTextButton),
|
||||
),
|
||||
padding: const EdgeInsets.all(8),
|
||||
padding: _paddingButton ?? const EdgeInsets.all(8),
|
||||
elevation: 0
|
||||
),
|
||||
child: Text(
|
||||
|
||||
Reference in New Issue
Block a user