mirror of
https://github.com/foss42/apidash.git
synced 2025-06-04 09:16:02 +08:00
Update Request cancelled error message
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
@ -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,
|
||||
)
|
||||
|
Reference in New Issue
Block a user