rework ui
This commit is contained in:
@@ -24,9 +24,11 @@ class CustomerDto {
|
||||
final int id;
|
||||
final String name;
|
||||
final String customerNumber;
|
||||
final String? zip;
|
||||
final String? city;
|
||||
final List<PictureDto> pictures;
|
||||
|
||||
CustomerDto({required this.id, required this.name, required this.customerNumber, required this.pictures});
|
||||
CustomerDto({required this.id, required this.name, required this.customerNumber, required this.pictures, this.zip, this.city});
|
||||
|
||||
/// Create from JSON response
|
||||
factory CustomerDto.fromJson(Map<String, dynamic> json) {
|
||||
@@ -34,9 +36,9 @@ class CustomerDto {
|
||||
id: json['id'] as int,
|
||||
name: json['name'] as String,
|
||||
customerNumber: json['customerNumber'] as String,
|
||||
zip: json['zip'] as String?,
|
||||
city: json['city'] as String?,
|
||||
pictures: List<PictureDto>.from(json["pictures"].map((x) => PictureDto.fromJson(x))),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -124,5 +124,25 @@
|
||||
"backButtonLabel": "zurück",
|
||||
"@backButtonLabel": {
|
||||
"description": "Back button label"
|
||||
},
|
||||
"pictureWidgetLabelCustomerNumber": "KUNDENNUMMER",
|
||||
"@pictureWidgetLabelCustomerNumber": {
|
||||
"description": "Picture widget label for customer number"
|
||||
},
|
||||
"pictureWidgetLabelZip": "PLZ",
|
||||
"@pictureWidgetLabelZip": {
|
||||
"description": "Picture widget label for zip code"
|
||||
},
|
||||
"pictureWidgetLabelCity": "ORT",
|
||||
"@pictureWidgetLabelCity": {
|
||||
"description": "Picture widget label for city"
|
||||
},
|
||||
"pictureWidgetLabelComment": "KOMMENTAR",
|
||||
"@pictureWidgetLabelComment": {
|
||||
"description": "Picture widget label for comment"
|
||||
},
|
||||
"pictureWidgetLabelEvaluation": "BEWERTUNG",
|
||||
"@pictureWidgetLabelEvaluation": {
|
||||
"description": "Picture widget label for evaluation"
|
||||
}
|
||||
}
|
||||
@@ -255,6 +255,36 @@ abstract class AppLocalizations {
|
||||
/// In de, this message translates to:
|
||||
/// **'zurück'**
|
||||
String get backButtonLabel;
|
||||
|
||||
/// Picture widget label for customer number
|
||||
///
|
||||
/// In de, this message translates to:
|
||||
/// **'KUNDENNUMMER'**
|
||||
String get pictureWidgetLabelCustomerNumber;
|
||||
|
||||
/// Picture widget label for zip code
|
||||
///
|
||||
/// In de, this message translates to:
|
||||
/// **'PLZ'**
|
||||
String get pictureWidgetLabelZip;
|
||||
|
||||
/// Picture widget label for city
|
||||
///
|
||||
/// In de, this message translates to:
|
||||
/// **'ORT'**
|
||||
String get pictureWidgetLabelCity;
|
||||
|
||||
/// Picture widget label for comment
|
||||
///
|
||||
/// In de, this message translates to:
|
||||
/// **'KOMMENTAR'**
|
||||
String get pictureWidgetLabelComment;
|
||||
|
||||
/// Picture widget label for evaluation
|
||||
///
|
||||
/// In de, this message translates to:
|
||||
/// **'BEWERTUNG'**
|
||||
String get pictureWidgetLabelEvaluation;
|
||||
}
|
||||
|
||||
class _AppLocalizationsDelegate
|
||||
|
||||
@@ -96,4 +96,19 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||
|
||||
@override
|
||||
String get backButtonLabel => 'zurück';
|
||||
|
||||
@override
|
||||
String get pictureWidgetLabelCustomerNumber => 'KUNDENNUMMER';
|
||||
|
||||
@override
|
||||
String get pictureWidgetLabelZip => 'PLZ';
|
||||
|
||||
@override
|
||||
String get pictureWidgetLabelCity => 'ORT';
|
||||
|
||||
@override
|
||||
String get pictureWidgetLabelComment => 'KOMMENTAR';
|
||||
|
||||
@override
|
||||
String get pictureWidgetLabelEvaluation => 'BEWERTUNG';
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ class _CustomerWidgetState extends State<CustomerWidget> {
|
||||
);
|
||||
|
||||
final dateStr = _dateFormat.format(pictureDto.pictureDate);
|
||||
final evaluationColor = _generalStyle.evaluationColor(value: pictureDto.evaluation); // FIXME: set to color from DB
|
||||
final evaluationColor = _generalStyle.evaluationColor(value: pictureDto.evaluation);
|
||||
return InkWell(
|
||||
key: Key("table_row_${customerDto.id}"),
|
||||
onTap: () => _actionSelect(context, customerDto, pictureDto),
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:fotodocumentation/controller/customer_controller.dart';
|
||||
import 'package:fotodocumentation/controller/picture_controller.dart';
|
||||
import 'package:fotodocumentation/dto/customer_dto.dart';
|
||||
import 'package:fotodocumentation/dto/picture_dto.dart';
|
||||
import 'package:fotodocumentation/l10n/app_localizations.dart';
|
||||
import 'package:fotodocumentation/pages/ui_utils/component/customer_back_button.dart';
|
||||
import 'package:fotodocumentation/pages/customer/picture_fullscreen_dialog.dart';
|
||||
import 'package:fotodocumentation/pages/ui_utils/component/general_error_widget.dart';
|
||||
@@ -200,7 +201,7 @@ class _PictureWidgetState extends State<PictureWidget> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"KUNDENNUMMER",
|
||||
AppLocalizations.of(context)!.pictureWidgetLabelCustomerNumber,
|
||||
style: labelStyle,
|
||||
),
|
||||
Padding(
|
||||
@@ -210,10 +211,32 @@ class _PictureWidgetState extends State<PictureWidget> {
|
||||
style: contentStyle,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.pictureWidgetLabelZip,
|
||||
style: labelStyle,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 4.0),
|
||||
child: Text(
|
||||
_customerDto.zip ?? "",
|
||||
style: contentStyle,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
AppLocalizations.of(context)!.pictureWidgetLabelCity,
|
||||
style: labelStyle,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 4.0),
|
||||
child: Text(
|
||||
_customerDto.city ?? "",
|
||||
style: contentStyle,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 20.0),
|
||||
child: Text(
|
||||
"KOMMENTAR",
|
||||
AppLocalizations.of(context)!.pictureWidgetLabelComment,
|
||||
style: labelStyle,
|
||||
),
|
||||
),
|
||||
@@ -258,7 +281,7 @@ class _PictureWidgetState extends State<PictureWidget> {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
"BEWERTUNG",
|
||||
AppLocalizations.of(context)!.pictureWidgetLabelEvaluation,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 16,
|
||||
@@ -333,6 +356,7 @@ class _PictureWidgetState extends State<PictureWidget> {
|
||||
children: [
|
||||
// Previous button
|
||||
IconButton(
|
||||
key: Key("navigate_left"),
|
||||
onPressed: hasPrevious ? () => _actionNavigateToPicture(currentIndex - 1) : null,
|
||||
icon: Icon(Icons.chevron_left, color: _generalStyle.nextTextColor, size: 32),
|
||||
),
|
||||
@@ -372,6 +396,7 @@ class _PictureWidgetState extends State<PictureWidget> {
|
||||
const SizedBox(width: 24),
|
||||
// Next button
|
||||
IconButton(
|
||||
key: Key("navigate_right"),
|
||||
onPressed: hasNext ? () => _actionNavigateToPicture(currentIndex + 1) : null,
|
||||
icon: Icon(Icons.chevron_right, color: _generalStyle.nextTextColor, size: 32),
|
||||
),
|
||||
@@ -383,9 +408,7 @@ class _PictureWidgetState extends State<PictureWidget> {
|
||||
Future<void> _actionUpdateEvaluation(int value) async {
|
||||
_selectedPicture?.evaluation = value;
|
||||
_pictureController.updateEvaluation(_selectedPicture!);
|
||||
setState(() {
|
||||
|
||||
});
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
void _actionNavigateToPicture(int index) {
|
||||
|
||||
@@ -90,6 +90,7 @@ class _LoginWidgetState extends State<LoginWidget> {
|
||||
children: [
|
||||
Center(
|
||||
child: Text(
|
||||
key: Key("login_title"),
|
||||
AppLocalizations.of(context)!.loginTitle,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
Reference in New Issue
Block a user