feat(web): add Exif-Rating (#11580)

* Add Exif-Rating

* Integrate star rating as own component

* Add e2e tests for rating and validation

* Rename component and async handleChangeRating

* Display rating can be enabled in app settings

* Correct i18n reference

Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com>

* Star rating: change from slider to buttons

* Star rating for clarity

* Design updates.

* Renaming and code optimization

* chore: clean up

* chore: e2e formatting

* light mode border and default value

---------

Co-authored-by: Christoph Suter <christoph@suter-burri.ch>
Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com>
Co-authored-by: Mert <101130780+mertalev@users.noreply.github.com>
Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Christoph Suter 2024-08-09 19:45:52 +02:00 committed by GitHub
parent b1587a5dee
commit f33dbdfe9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 599 additions and 18 deletions

View file

@ -32,6 +32,7 @@ class ExifResponseDto {
this.modifyDate,
this.orientation,
this.projectionType,
this.rating,
this.state,
this.timeZone,
});
@ -74,6 +75,8 @@ class ExifResponseDto {
String? projectionType;
num? rating;
String? state;
String? timeZone;
@ -99,6 +102,7 @@ class ExifResponseDto {
other.modifyDate == modifyDate &&
other.orientation == orientation &&
other.projectionType == projectionType &&
other.rating == rating &&
other.state == state &&
other.timeZone == timeZone;
@ -124,11 +128,12 @@ class ExifResponseDto {
(modifyDate == null ? 0 : modifyDate!.hashCode) +
(orientation == null ? 0 : orientation!.hashCode) +
(projectionType == null ? 0 : projectionType!.hashCode) +
(rating == null ? 0 : rating!.hashCode) +
(state == null ? 0 : state!.hashCode) +
(timeZone == null ? 0 : timeZone!.hashCode);
@override
String toString() => 'ExifResponseDto[city=$city, country=$country, dateTimeOriginal=$dateTimeOriginal, description=$description, exifImageHeight=$exifImageHeight, exifImageWidth=$exifImageWidth, exposureTime=$exposureTime, fNumber=$fNumber, fileSizeInByte=$fileSizeInByte, focalLength=$focalLength, iso=$iso, latitude=$latitude, lensModel=$lensModel, longitude=$longitude, make=$make, model=$model, modifyDate=$modifyDate, orientation=$orientation, projectionType=$projectionType, state=$state, timeZone=$timeZone]';
String toString() => 'ExifResponseDto[city=$city, country=$country, dateTimeOriginal=$dateTimeOriginal, description=$description, exifImageHeight=$exifImageHeight, exifImageWidth=$exifImageWidth, exposureTime=$exposureTime, fNumber=$fNumber, fileSizeInByte=$fileSizeInByte, focalLength=$focalLength, iso=$iso, latitude=$latitude, lensModel=$lensModel, longitude=$longitude, make=$make, model=$model, modifyDate=$modifyDate, orientation=$orientation, projectionType=$projectionType, rating=$rating, state=$state, timeZone=$timeZone]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -227,6 +232,11 @@ class ExifResponseDto {
} else {
// json[r'projectionType'] = null;
}
if (this.rating != null) {
json[r'rating'] = this.rating;
} else {
// json[r'rating'] = null;
}
if (this.state != null) {
json[r'state'] = this.state;
} else {
@ -281,6 +291,9 @@ class ExifResponseDto {
modifyDate: mapDateTime(json, r'modifyDate', r''),
orientation: mapValueOfType<String>(json, r'orientation'),
projectionType: mapValueOfType<String>(json, r'projectionType'),
rating: json[r'rating'] == null
? null
: num.parse('${json[r'rating']}'),
state: mapValueOfType<String>(json, r'state'),
timeZone: mapValueOfType<String>(json, r'timeZone'),
);