require non-null error in card error widget
This commit is contained in:
parent
262b448df3
commit
54975adbb3
4 changed files with 5 additions and 5 deletions
|
|
@ -103,7 +103,7 @@ class ITFeedbackCardController extends State<ITFeedbackCard> {
|
|||
@override
|
||||
Widget build(BuildContext context) => error == null
|
||||
? ITFeedbackCardView(controller: this)
|
||||
: CardErrorWidget(error: error);
|
||||
: CardErrorWidget(error: error!);
|
||||
}
|
||||
|
||||
class ITFeedbackCardView extends StatelessWidget {
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ class MessageSpeechToTextCardState extends State<MessageSpeechToTextCard> {
|
|||
// done fetchig but not results means some kind of error
|
||||
if (speechToTextResponse == null) {
|
||||
return CardErrorWidget(
|
||||
error: error,
|
||||
error: error ?? "Failed to fetch speech to text",
|
||||
maxWidth: AppConfig.toolbarMinWidth,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@ import 'package:fluffychat/pangea/widgets/igc/card_header.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class CardErrorWidget extends StatelessWidget {
|
||||
final Object? error;
|
||||
final Object error;
|
||||
final Choreographer? choreographer;
|
||||
final int? offset;
|
||||
final double? maxWidth;
|
||||
|
||||
const CardErrorWidget({
|
||||
super.key,
|
||||
this.error,
|
||||
required this.error,
|
||||
this.choreographer,
|
||||
this.offset,
|
||||
this.maxWidth,
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ class WordDataCardView extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
if (controller.wordNetError != null) {
|
||||
return CardErrorWidget(
|
||||
error: controller.wordNetError,
|
||||
error: controller.wordNetError!,
|
||||
maxWidth: AppConfig.toolbarMinWidth,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue