Improved by resolving the last two fixme

This commit is contained in:
verboomp
2026-02-05 09:25:13 +01:00
parent cb5d0de5b2
commit bb4d7fbf68
4 changed files with 15 additions and 2 deletions

View File

@@ -144,5 +144,9 @@
"pictureWidgetLabelEvaluation": "BEWERTUNG",
"@pictureWidgetLabelEvaluation": {
"description": "Picture widget label for evaluation"
},
"pictureWidgetNotFound": "Das Bild konnte nicht gefunden werden.",
"@pictureWidgetNotFound": {
"description": "Picture not found error message"
}
}

View File

@@ -285,6 +285,12 @@ abstract class AppLocalizations {
/// In de, this message translates to:
/// **'BEWERTUNG'**
String get pictureWidgetLabelEvaluation;
/// Picture not found error message
///
/// In de, this message translates to:
/// **'Das Bild konnte nicht gefunden werden.'**
String get pictureWidgetNotFound;
}
class _AppLocalizationsDelegate

View File

@@ -111,4 +111,7 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get pictureWidgetLabelEvaluation => 'BEWERTUNG';
@override
String get pictureWidgetNotFound => 'Das Bild konnte nicht gefunden werden.';
}

View File

@@ -72,13 +72,13 @@ class _PictureWidgetState extends State<PictureWidget> {
if (snapshot.hasData) {
CustomerDto? dto = snapshot.data;
if (dto == null) {
return GeneralErrorWidget(error: "FIXME"); // FIXME: set error text data not found
return GeneralErrorWidget(error: AppLocalizations.of(context)!.customerWidgetNotFound);
}
_customerDto = dto;
_selectedPicture ??= dto.pictures.firstWhere((p) => p.id == widget.pictureId);
_selectedPicture ??= _customerDto.pictures.firstOrNull;
if (_selectedPicture == null) {
return GeneralErrorWidget(error: "FIXME"); // FIXME: set error text data not found
return GeneralErrorWidget(error: AppLocalizations.of(context)!.pictureWidgetNotFound);
}
return _body(context, _selectedPicture!);
} else if (snapshot.hasError) {