Update Request cancelled error message

This commit is contained in:
Ashita Prasad
2024-12-16 04:45:32 +05:30
parent 1ea4dd07b4
commit 10bc6f34af
2 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,4 @@
import 'package:apidash_core/apidash_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:apidash/providers/providers.dart';
@ -28,7 +29,15 @@ class ResponsePane extends ConsumerWidget {
return const NotSentWidget();
}
if (responseStatus == -1) {
return ErrorMessage(message: '$message. $kUnexpectedRaiseIssue');
return message == kMsgRequestCancelled
? ErrorMessage(
message: message,
icon: Icons.cancel,
showIssueButton: false,
)
: ErrorMessage(
message: '$message. $kUnexpectedRaiseIssue',
);
}
return const ResponseDetails();
}

View File

@ -7,11 +7,13 @@ class ErrorMessage extends StatelessWidget {
const ErrorMessage({
super.key,
required this.message,
this.icon = Icons.warning_rounded,
this.showIcon = true,
this.showIssueButton = true,
});
final String? message;
final IconData icon;
final bool showIcon;
final bool showIssueButton;
@ -27,7 +29,7 @@ class ErrorMessage extends StatelessWidget {
children: [
showIcon
? Icon(
Icons.warning_rounded,
icon,
size: 40,
color: color,
)