Improved by resolving the last two fixme
This commit is contained in:
@@ -144,5 +144,9 @@
|
|||||||
"pictureWidgetLabelEvaluation": "BEWERTUNG",
|
"pictureWidgetLabelEvaluation": "BEWERTUNG",
|
||||||
"@pictureWidgetLabelEvaluation": {
|
"@pictureWidgetLabelEvaluation": {
|
||||||
"description": "Picture widget label for evaluation"
|
"description": "Picture widget label for evaluation"
|
||||||
|
},
|
||||||
|
"pictureWidgetNotFound": "Das Bild konnte nicht gefunden werden.",
|
||||||
|
"@pictureWidgetNotFound": {
|
||||||
|
"description": "Picture not found error message"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -285,6 +285,12 @@ abstract class AppLocalizations {
|
|||||||
/// In de, this message translates to:
|
/// In de, this message translates to:
|
||||||
/// **'BEWERTUNG'**
|
/// **'BEWERTUNG'**
|
||||||
String get pictureWidgetLabelEvaluation;
|
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
|
class _AppLocalizationsDelegate
|
||||||
|
|||||||
@@ -111,4 +111,7 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
String get pictureWidgetLabelEvaluation => 'BEWERTUNG';
|
String get pictureWidgetLabelEvaluation => 'BEWERTUNG';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get pictureWidgetNotFound => 'Das Bild konnte nicht gefunden werden.';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,13 +72,13 @@ class _PictureWidgetState extends State<PictureWidget> {
|
|||||||
if (snapshot.hasData) {
|
if (snapshot.hasData) {
|
||||||
CustomerDto? dto = snapshot.data;
|
CustomerDto? dto = snapshot.data;
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return GeneralErrorWidget(error: "FIXME"); // FIXME: set error text data not found
|
return GeneralErrorWidget(error: AppLocalizations.of(context)!.customerWidgetNotFound);
|
||||||
}
|
}
|
||||||
_customerDto = dto;
|
_customerDto = dto;
|
||||||
_selectedPicture ??= dto.pictures.firstWhere((p) => p.id == widget.pictureId);
|
_selectedPicture ??= dto.pictures.firstWhere((p) => p.id == widget.pictureId);
|
||||||
_selectedPicture ??= _customerDto.pictures.firstOrNull;
|
_selectedPicture ??= _customerDto.pictures.firstOrNull;
|
||||||
if (_selectedPicture == null) {
|
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!);
|
return _body(context, _selectedPicture!);
|
||||||
} else if (snapshot.hasError) {
|
} else if (snapshot.hasError) {
|
||||||
|
|||||||
Reference in New Issue
Block a user