mirror of
https://github.com/foss42/apidash.git
synced 2025-06-20 22:24:08 +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/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:apidash/providers/providers.dart';
|
import 'package:apidash/providers/providers.dart';
|
||||||
@ -28,7 +29,15 @@ class ResponsePane extends ConsumerWidget {
|
|||||||
return const NotSentWidget();
|
return const NotSentWidget();
|
||||||
}
|
}
|
||||||
if (responseStatus == -1) {
|
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();
|
return const ResponseDetails();
|
||||||
}
|
}
|
||||||
|
@ -7,11 +7,13 @@ class ErrorMessage extends StatelessWidget {
|
|||||||
const ErrorMessage({
|
const ErrorMessage({
|
||||||
super.key,
|
super.key,
|
||||||
required this.message,
|
required this.message,
|
||||||
|
this.icon = Icons.warning_rounded,
|
||||||
this.showIcon = true,
|
this.showIcon = true,
|
||||||
this.showIssueButton = true,
|
this.showIssueButton = true,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String? message;
|
final String? message;
|
||||||
|
final IconData icon;
|
||||||
final bool showIcon;
|
final bool showIcon;
|
||||||
final bool showIssueButton;
|
final bool showIssueButton;
|
||||||
|
|
||||||
@ -27,7 +29,7 @@ class ErrorMessage extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
showIcon
|
showIcon
|
||||||
? Icon(
|
? Icon(
|
||||||
Icons.warning_rounded,
|
icon,
|
||||||
size: 40,
|
size: 40,
|
||||||
color: color,
|
color: color,
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user