Remove unused localizations arguments in Scribe suggestion
This commit is contained in:
@@ -64,13 +64,12 @@ mixin AiScribeSuggestionStateMixin<T extends StatefulWidget> on State<T> {
|
|||||||
|
|
||||||
Widget buildStateContent(
|
Widget buildStateContent(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
ScribeLocalizations localizations,
|
|
||||||
) {
|
) {
|
||||||
return ValueListenableBuilder<dartz.Either<Failure, Success>>(
|
return ValueListenableBuilder<dartz.Either<Failure, Success>>(
|
||||||
valueListenable: _suggestionState,
|
valueListenable: _suggestionState,
|
||||||
builder: (_, stateValue, __) {
|
builder: (_, stateValue, __) {
|
||||||
return stateValue.fold(
|
return stateValue.fold(
|
||||||
(failure) => buildErrorState(localizations),
|
(failure) => buildErrorState(),
|
||||||
(value) {
|
(value) {
|
||||||
if (value is GenerateAITextSuccess) {
|
if (value is GenerateAITextSuccess) {
|
||||||
final hasContent = content?.trim().isNotEmpty == true;
|
final hasContent = content?.trim().isNotEmpty == true;
|
||||||
@@ -78,23 +77,22 @@ mixin AiScribeSuggestionStateMixin<T extends StatefulWidget> on State<T> {
|
|||||||
return buildSuccessState(
|
return buildSuccessState(
|
||||||
value.response.result,
|
value.response.result,
|
||||||
hasContent,
|
hasContent,
|
||||||
localizations,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return buildLoadingState(localizations);
|
return buildLoadingState();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildLoadingState(ScribeLocalizations localizations) {
|
Widget buildLoadingState() {
|
||||||
return AiScribeSuggestionLoading(
|
return AiScribeSuggestionLoading(
|
||||||
imagePaths: imagePaths,
|
imagePaths: imagePaths,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildErrorState(ScribeLocalizations localizations) {
|
Widget buildErrorState() {
|
||||||
return AiScribeSuggestionError(
|
return AiScribeSuggestionError(
|
||||||
imagePaths: imagePaths,
|
imagePaths: imagePaths,
|
||||||
);
|
);
|
||||||
@@ -103,7 +101,6 @@ mixin AiScribeSuggestionStateMixin<T extends StatefulWidget> on State<T> {
|
|||||||
Widget buildSuccessState(
|
Widget buildSuccessState(
|
||||||
String suggestionText,
|
String suggestionText,
|
||||||
bool hasContent,
|
bool hasContent,
|
||||||
ScribeLocalizations localizations,
|
|
||||||
) {
|
) {
|
||||||
return AiScribeSuggestionSuccess(
|
return AiScribeSuggestionSuccess(
|
||||||
imagePaths: imagePaths,
|
imagePaths: imagePaths,
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ class _AiScribeSuggestionWidgetState extends State<AiScribeSuggestionWidget>
|
|||||||
imagePaths: widget.imagePaths,
|
imagePaths: widget.imagePaths,
|
||||||
),
|
),
|
||||||
Flexible(
|
Flexible(
|
||||||
child: buildStateContent(context, localizations),
|
child: buildStateContent(context),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user