fix: replace first and last name with single field (#4915)

This commit is contained in:
Brian Austin
2023-11-11 20:03:32 -05:00
committed by GitHub
parent 413ab2c538
commit 7fca0d8da5
98 changed files with 567 additions and 1147 deletions
+1 -1
View File
@@ -114,7 +114,7 @@
"cache_settings_thumbnail_size": "Thumbnail cache size ({} assets)",
"cache_settings_title": "Caching Settings",
"change_password_form_confirm_password": "Confirm Password",
"change_password_form_description": "Hi {firstName} {lastName},\n\nThis is either the first time you are signing into the system or a request has been made to change your password. Please enter the new password below.",
"change_password_form_description": "Hi {name},\n\nThis is either the first time you are signing into the system or a request has been made to change your password. Please enter the new password below.",
"change_password_form_new_password": "New Password",
"change_password_form_password_mismatch": "Passwords do not match",
"change_password_form_reenter_new_password": "Re-enter New Password",
@@ -48,8 +48,7 @@ class Activity {
: ActivityType.like,
user = User(
email: dto.user.email,
firstName: dto.user.firstName,
lastName: dto.user.lastName,
name: dto.user.name,
profileImagePath: dto.user.profileImagePath,
id: dto.user.id,
// Placeholder values
@@ -61,7 +61,7 @@ class ActivitiesPage extends HookConsumerWidget {
mainAxisSize: leftAlign ? MainAxisSize.min : MainAxisSize.max,
children: [
Text(
"${activity.user.firstName} ${activity.user.lastName}",
activity.user.name,
style: textStyle,
overflow: TextOverflow.ellipsis,
),
@@ -124,7 +124,7 @@ class AlbumOptionsPage extends HookConsumerWidget {
)
: const SizedBox(),
title: Text(
album.owner.value?.firstName ?? "",
album.owner.value?.name ?? "",
style: const TextStyle(
fontWeight: FontWeight.bold,
),
@@ -155,7 +155,7 @@ class AlbumOptionsPage extends HookConsumerWidget {
radius: 22,
),
title: Text(
user.firstName,
user.name,
style: const TextStyle(
fontWeight: FontWeight.bold,
),
@@ -3,8 +3,7 @@ class AuthenticationState {
final String userId;
final String userEmail;
final bool isAuthenticated;
final String firstName;
final String lastName;
final String name;
final bool isAdmin;
final bool shouldChangePassword;
final String profileImagePath;
@@ -13,8 +12,7 @@ class AuthenticationState {
required this.userId,
required this.userEmail,
required this.isAuthenticated,
required this.firstName,
required this.lastName,
required this.name,
required this.isAdmin,
required this.shouldChangePassword,
required this.profileImagePath,
@@ -25,8 +23,7 @@ class AuthenticationState {
String? userId,
String? userEmail,
bool? isAuthenticated,
String? firstName,
String? lastName,
String? name,
bool? isAdmin,
bool? shouldChangePassword,
String? profileImagePath,
@@ -36,8 +33,7 @@ class AuthenticationState {
userId: userId ?? this.userId,
userEmail: userEmail ?? this.userEmail,
isAuthenticated: isAuthenticated ?? this.isAuthenticated,
firstName: firstName ?? this.firstName,
lastName: lastName ?? this.lastName,
name: name ?? this.name,
isAdmin: isAdmin ?? this.isAdmin,
shouldChangePassword: shouldChangePassword ?? this.shouldChangePassword,
profileImagePath: profileImagePath ?? this.profileImagePath,
@@ -46,7 +42,7 @@ class AuthenticationState {
@override
String toString() {
return 'AuthenticationState(deviceId: $deviceId, userId: $userId, userEmail: $userEmail, isAuthenticated: $isAuthenticated, firstName: $firstName, lastName: $lastName, isAdmin: $isAdmin, shouldChangePassword: $shouldChangePassword, profileImagePath: $profileImagePath)';
return 'AuthenticationState(deviceId: $deviceId, userId: $userId, userEmail: $userEmail, isAuthenticated: $isAuthenticated, name: $name, isAdmin: $isAdmin, shouldChangePassword: $shouldChangePassword, profileImagePath: $profileImagePath)';
}
@override
@@ -58,8 +54,7 @@ class AuthenticationState {
other.userId == userId &&
other.userEmail == userEmail &&
other.isAuthenticated == isAuthenticated &&
other.firstName == firstName &&
other.lastName == lastName &&
other.name == name &&
other.isAdmin == isAdmin &&
other.shouldChangePassword == shouldChangePassword &&
other.profileImagePath == profileImagePath;
@@ -71,8 +66,7 @@ class AuthenticationState {
userId.hashCode ^
userEmail.hashCode ^
isAuthenticated.hashCode ^
firstName.hashCode ^
lastName.hashCode ^
name.hashCode ^
isAdmin.hashCode ^
shouldChangePassword.hashCode ^
profileImagePath.hashCode;
@@ -26,8 +26,7 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
deviceId: "",
userId: "",
userEmail: "",
firstName: '',
lastName: '',
name: '',
profileImagePath: '',
isAdmin: false,
shouldChangePassword: false,
@@ -117,8 +116,7 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
deviceId: "",
userId: "",
userEmail: "",
firstName: '',
lastName: '',
name: '',
profileImagePath: '',
isAdmin: false,
shouldChangePassword: false,
@@ -208,8 +206,7 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
isAuthenticated: true,
userId: user.id,
userEmail: user.email,
firstName: user.firstName,
lastName: user.lastName,
name: user.name,
profileImagePath: user.profileImagePath,
isAdmin: user.isAdmin,
shouldChangePassword: shouldChangePassword,
@@ -46,8 +46,7 @@ class ChangePasswordForm extends HookConsumerWidget {
child: Text(
'change_password_form_description'.tr(
namedArgs: {
'firstName': authState.firstName,
'lastName': authState.lastName,
'name': authState.name,
},
),
style: TextStyle(
@@ -24,7 +24,7 @@ class PartnerList extends HookConsumerWidget {
contentPadding: const EdgeInsets.symmetric(horizontal: 12.0),
leading: userAvatar(context, p, radius: 30),
title: Text(
"${p.firstName} ${p.lastName}'s photos",
"${p.name}'s photos",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
@@ -25,7 +25,7 @@ class PartnerDetailPage extends HookConsumerWidget {
return Scaffold(
appBar: AppBar(
title: Text("${partner.firstName} ${partner.lastName}"),
title: Text(partner.name),
elevation: 0,
centerTitle: false,
),
@@ -34,7 +34,7 @@ class PartnerDetailPage extends HookConsumerWidget {
? Padding(
padding: const EdgeInsets.all(16),
child: Text(
"It seems ${partner.firstName} does not have any photos...\n"
"It seems ${partner.name} does not have any photos...\n"
"Or your server version does not match the app version."),
)
: ImmichAssetGrid(
@@ -41,7 +41,7 @@ class PartnerPage extends HookConsumerWidget {
padding: const EdgeInsets.only(right: 8),
child: userAvatar(context, u),
),
Text("${u.firstName} ${u.lastName}"),
Text(u.name),
],
),
),
@@ -71,7 +71,7 @@ class PartnerPage extends HookConsumerWidget {
return ConfirmDialog(
title: "partner_page_stop_sharing_title",
content:
"partner_page_stop_sharing_content".tr(args: [u.firstName]),
"partner_page_stop_sharing_content".tr(args: [u.name]),
onOk: () => ref.read(partnerServiceProvider).removePartner(u),
);
},
+2 -5
View File
@@ -68,11 +68,8 @@ class Album {
}
final name = <String>[];
if (owner.value?.firstName != null) {
name.add(owner.value!.firstName);
}
if (owner.value?.lastName != null) {
name.add(owner.value!.lastName);
if (owner.value?.name != null) {
name.add(owner.value!.name);
}
return name.join(' ');
+6 -12
View File
@@ -11,8 +11,7 @@ class User {
required this.id,
required this.updatedAt,
required this.email,
required this.firstName,
required this.lastName,
required this.name,
required this.isAdmin,
this.isPartnerSharedBy = false,
this.isPartnerSharedWith = false,
@@ -27,8 +26,7 @@ class User {
: id = dto.id,
updatedAt = dto.updatedAt,
email = dto.email,
firstName = dto.firstName,
lastName = dto.lastName,
name = dto.name,
isPartnerSharedBy = false,
isPartnerSharedWith = false,
profileImagePath = dto.profileImagePath,
@@ -39,8 +37,7 @@ class User {
: id = dto.id,
updatedAt = dto.updatedAt,
email = dto.email,
firstName = dto.firstName,
lastName = dto.lastName,
name = dto.name,
isPartnerSharedBy = false,
isPartnerSharedWith = false,
profileImagePath = dto.profileImagePath,
@@ -52,8 +49,7 @@ class User {
String id;
DateTime updatedAt;
String email;
String firstName;
String lastName;
String name;
bool isPartnerSharedBy;
bool isPartnerSharedWith;
bool isAdmin;
@@ -72,8 +68,7 @@ class User {
return id == other.id &&
updatedAt.isAtSameMomentAs(other.updatedAt) &&
email == other.email &&
firstName == other.firstName &&
lastName == other.lastName &&
name == other.name &&
isPartnerSharedBy == other.isPartnerSharedBy &&
isPartnerSharedWith == other.isPartnerSharedWith &&
profileImagePath == other.profileImagePath &&
@@ -88,8 +83,7 @@ class User {
id.hashCode ^
updatedAt.hashCode ^
email.hashCode ^
firstName.hashCode ^
lastName.hashCode ^
name.hashCode ^
isPartnerSharedBy.hashCode ^
isPartnerSharedWith.hashCode ^
profileImagePath.hashCode ^
+202 -380
View File
@@ -22,53 +22,48 @@ const UserSchema = CollectionSchema(
name: r'email',
type: IsarType.string,
),
r'firstName': PropertySchema(
id: 1,
name: r'firstName',
type: IsarType.string,
),
r'id': PropertySchema(
id: 2,
id: 1,
name: r'id',
type: IsarType.string,
),
r'inTimeline': PropertySchema(
id: 3,
id: 2,
name: r'inTimeline',
type: IsarType.bool,
),
r'isAdmin': PropertySchema(
id: 4,
id: 3,
name: r'isAdmin',
type: IsarType.bool,
),
r'isPartnerSharedBy': PropertySchema(
id: 5,
id: 4,
name: r'isPartnerSharedBy',
type: IsarType.bool,
),
r'isPartnerSharedWith': PropertySchema(
id: 6,
id: 5,
name: r'isPartnerSharedWith',
type: IsarType.bool,
),
r'lastName': PropertySchema(
id: 7,
name: r'lastName',
type: IsarType.string,
),
r'memoryEnabled': PropertySchema(
id: 8,
id: 6,
name: r'memoryEnabled',
type: IsarType.bool,
),
r'name': PropertySchema(
id: 7,
name: r'name',
type: IsarType.string,
),
r'profileImagePath': PropertySchema(
id: 9,
id: 8,
name: r'profileImagePath',
type: IsarType.string,
),
r'updatedAt': PropertySchema(
id: 10,
id: 9,
name: r'updatedAt',
type: IsarType.dateTime,
)
@@ -123,9 +118,8 @@ int _userEstimateSize(
) {
var bytesCount = offsets.last;
bytesCount += 3 + object.email.length * 3;
bytesCount += 3 + object.firstName.length * 3;
bytesCount += 3 + object.id.length * 3;
bytesCount += 3 + object.lastName.length * 3;
bytesCount += 3 + object.name.length * 3;
bytesCount += 3 + object.profileImagePath.length * 3;
return bytesCount;
}
@@ -137,16 +131,15 @@ void _userSerialize(
Map<Type, List<int>> allOffsets,
) {
writer.writeString(offsets[0], object.email);
writer.writeString(offsets[1], object.firstName);
writer.writeString(offsets[2], object.id);
writer.writeBool(offsets[3], object.inTimeline);
writer.writeBool(offsets[4], object.isAdmin);
writer.writeBool(offsets[5], object.isPartnerSharedBy);
writer.writeBool(offsets[6], object.isPartnerSharedWith);
writer.writeString(offsets[7], object.lastName);
writer.writeBool(offsets[8], object.memoryEnabled);
writer.writeString(offsets[9], object.profileImagePath);
writer.writeDateTime(offsets[10], object.updatedAt);
writer.writeString(offsets[1], object.id);
writer.writeBool(offsets[2], object.inTimeline);
writer.writeBool(offsets[3], object.isAdmin);
writer.writeBool(offsets[4], object.isPartnerSharedBy);
writer.writeBool(offsets[5], object.isPartnerSharedWith);
writer.writeBool(offsets[6], object.memoryEnabled);
writer.writeString(offsets[7], object.name);
writer.writeString(offsets[8], object.profileImagePath);
writer.writeDateTime(offsets[9], object.updatedAt);
}
User _userDeserialize(
@@ -157,16 +150,15 @@ User _userDeserialize(
) {
final object = User(
email: reader.readString(offsets[0]),
firstName: reader.readString(offsets[1]),
id: reader.readString(offsets[2]),
inTimeline: reader.readBoolOrNull(offsets[3]),
isAdmin: reader.readBool(offsets[4]),
isPartnerSharedBy: reader.readBoolOrNull(offsets[5]) ?? false,
isPartnerSharedWith: reader.readBoolOrNull(offsets[6]) ?? false,
lastName: reader.readString(offsets[7]),
memoryEnabled: reader.readBoolOrNull(offsets[8]),
profileImagePath: reader.readStringOrNull(offsets[9]) ?? '',
updatedAt: reader.readDateTime(offsets[10]),
id: reader.readString(offsets[1]),
inTimeline: reader.readBoolOrNull(offsets[2]),
isAdmin: reader.readBool(offsets[3]),
isPartnerSharedBy: reader.readBoolOrNull(offsets[4]) ?? false,
isPartnerSharedWith: reader.readBoolOrNull(offsets[5]) ?? false,
memoryEnabled: reader.readBoolOrNull(offsets[6]),
name: reader.readString(offsets[7]),
profileImagePath: reader.readStringOrNull(offsets[8]) ?? '',
updatedAt: reader.readDateTime(offsets[9]),
);
return object;
}
@@ -183,22 +175,20 @@ P _userDeserializeProp<P>(
case 1:
return (reader.readString(offset)) as P;
case 2:
return (reader.readString(offset)) as P;
case 3:
return (reader.readBoolOrNull(offset)) as P;
case 4:
case 3:
return (reader.readBool(offset)) as P;
case 4:
return (reader.readBoolOrNull(offset) ?? false) as P;
case 5:
return (reader.readBoolOrNull(offset) ?? false) as P;
case 6:
return (reader.readBoolOrNull(offset) ?? false) as P;
return (reader.readBoolOrNull(offset)) as P;
case 7:
return (reader.readString(offset)) as P;
case 8:
return (reader.readBoolOrNull(offset)) as P;
case 9:
return (reader.readStringOrNull(offset) ?? '') as P;
case 10:
case 9:
return (reader.readDateTime(offset)) as P;
default:
throw IsarError('Unknown property with id $propertyId');
@@ -520,136 +510,6 @@ extension UserQueryFilter on QueryBuilder<User, User, QFilterCondition> {
});
}
QueryBuilder<User, User, QAfterFilterCondition> firstNameEqualTo(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
property: r'firstName',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> firstNameGreaterThan(
String value, {
bool include = false,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan(
include: include,
property: r'firstName',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> firstNameLessThan(
String value, {
bool include = false,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan(
include: include,
property: r'firstName',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> firstNameBetween(
String lower,
String upper, {
bool includeLower = true,
bool includeUpper = true,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.between(
property: r'firstName',
lower: lower,
includeLower: includeLower,
upper: upper,
includeUpper: includeUpper,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> firstNameStartsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.startsWith(
property: r'firstName',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> firstNameEndsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.endsWith(
property: r'firstName',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> firstNameContains(
String value,
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.contains(
property: r'firstName',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> firstNameMatches(
String pattern,
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.matches(
property: r'firstName',
wildcard: pattern,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> firstNameIsEmpty() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
property: r'firstName',
value: '',
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> firstNameIsNotEmpty() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan(
property: r'firstName',
value: '',
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> idEqualTo(
String value, {
bool caseSensitive = true,
@@ -885,135 +745,6 @@ extension UserQueryFilter on QueryBuilder<User, User, QFilterCondition> {
});
}
QueryBuilder<User, User, QAfterFilterCondition> lastNameEqualTo(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
property: r'lastName',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> lastNameGreaterThan(
String value, {
bool include = false,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan(
include: include,
property: r'lastName',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> lastNameLessThan(
String value, {
bool include = false,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan(
include: include,
property: r'lastName',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> lastNameBetween(
String lower,
String upper, {
bool includeLower = true,
bool includeUpper = true,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.between(
property: r'lastName',
lower: lower,
includeLower: includeLower,
upper: upper,
includeUpper: includeUpper,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> lastNameStartsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.startsWith(
property: r'lastName',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> lastNameEndsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.endsWith(
property: r'lastName',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> lastNameContains(String value,
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.contains(
property: r'lastName',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> lastNameMatches(
String pattern,
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.matches(
property: r'lastName',
wildcard: pattern,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> lastNameIsEmpty() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
property: r'lastName',
value: '',
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> lastNameIsNotEmpty() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan(
property: r'lastName',
value: '',
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> memoryEnabledIsNull() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(const FilterCondition.isNull(
@@ -1040,6 +771,134 @@ extension UserQueryFilter on QueryBuilder<User, User, QFilterCondition> {
});
}
QueryBuilder<User, User, QAfterFilterCondition> nameEqualTo(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
property: r'name',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> nameGreaterThan(
String value, {
bool include = false,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan(
include: include,
property: r'name',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> nameLessThan(
String value, {
bool include = false,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan(
include: include,
property: r'name',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> nameBetween(
String lower,
String upper, {
bool includeLower = true,
bool includeUpper = true,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.between(
property: r'name',
lower: lower,
includeLower: includeLower,
upper: upper,
includeUpper: includeUpper,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> nameStartsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.startsWith(
property: r'name',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> nameEndsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.endsWith(
property: r'name',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> nameContains(String value,
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.contains(
property: r'name',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> nameMatches(String pattern,
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.matches(
property: r'name',
wildcard: pattern,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> nameIsEmpty() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
property: r'name',
value: '',
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> nameIsNotEmpty() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan(
property: r'name',
value: '',
));
});
}
QueryBuilder<User, User, QAfterFilterCondition> profileImagePathEqualTo(
String value, {
bool caseSensitive = true,
@@ -1352,18 +1211,6 @@ extension UserQuerySortBy on QueryBuilder<User, User, QSortBy> {
});
}
QueryBuilder<User, User, QAfterSortBy> sortByFirstName() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'firstName', Sort.asc);
});
}
QueryBuilder<User, User, QAfterSortBy> sortByFirstNameDesc() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'firstName', Sort.desc);
});
}
QueryBuilder<User, User, QAfterSortBy> sortById() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'id', Sort.asc);
@@ -1424,18 +1271,6 @@ extension UserQuerySortBy on QueryBuilder<User, User, QSortBy> {
});
}
QueryBuilder<User, User, QAfterSortBy> sortByLastName() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'lastName', Sort.asc);
});
}
QueryBuilder<User, User, QAfterSortBy> sortByLastNameDesc() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'lastName', Sort.desc);
});
}
QueryBuilder<User, User, QAfterSortBy> sortByMemoryEnabled() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'memoryEnabled', Sort.asc);
@@ -1448,6 +1283,18 @@ extension UserQuerySortBy on QueryBuilder<User, User, QSortBy> {
});
}
QueryBuilder<User, User, QAfterSortBy> sortByName() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'name', Sort.asc);
});
}
QueryBuilder<User, User, QAfterSortBy> sortByNameDesc() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'name', Sort.desc);
});
}
QueryBuilder<User, User, QAfterSortBy> sortByProfileImagePath() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'profileImagePath', Sort.asc);
@@ -1486,18 +1333,6 @@ extension UserQuerySortThenBy on QueryBuilder<User, User, QSortThenBy> {
});
}
QueryBuilder<User, User, QAfterSortBy> thenByFirstName() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'firstName', Sort.asc);
});
}
QueryBuilder<User, User, QAfterSortBy> thenByFirstNameDesc() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'firstName', Sort.desc);
});
}
QueryBuilder<User, User, QAfterSortBy> thenById() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'id', Sort.asc);
@@ -1570,18 +1405,6 @@ extension UserQuerySortThenBy on QueryBuilder<User, User, QSortThenBy> {
});
}
QueryBuilder<User, User, QAfterSortBy> thenByLastName() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'lastName', Sort.asc);
});
}
QueryBuilder<User, User, QAfterSortBy> thenByLastNameDesc() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'lastName', Sort.desc);
});
}
QueryBuilder<User, User, QAfterSortBy> thenByMemoryEnabled() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'memoryEnabled', Sort.asc);
@@ -1594,6 +1417,18 @@ extension UserQuerySortThenBy on QueryBuilder<User, User, QSortThenBy> {
});
}
QueryBuilder<User, User, QAfterSortBy> thenByName() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'name', Sort.asc);
});
}
QueryBuilder<User, User, QAfterSortBy> thenByNameDesc() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'name', Sort.desc);
});
}
QueryBuilder<User, User, QAfterSortBy> thenByProfileImagePath() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'profileImagePath', Sort.asc);
@@ -1627,13 +1462,6 @@ extension UserQueryWhereDistinct on QueryBuilder<User, User, QDistinct> {
});
}
QueryBuilder<User, User, QDistinct> distinctByFirstName(
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addDistinctBy(r'firstName', caseSensitive: caseSensitive);
});
}
QueryBuilder<User, User, QDistinct> distinctById(
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
@@ -1665,19 +1493,19 @@ extension UserQueryWhereDistinct on QueryBuilder<User, User, QDistinct> {
});
}
QueryBuilder<User, User, QDistinct> distinctByLastName(
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addDistinctBy(r'lastName', caseSensitive: caseSensitive);
});
}
QueryBuilder<User, User, QDistinct> distinctByMemoryEnabled() {
return QueryBuilder.apply(this, (query) {
return query.addDistinctBy(r'memoryEnabled');
});
}
QueryBuilder<User, User, QDistinct> distinctByName(
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addDistinctBy(r'name', caseSensitive: caseSensitive);
});
}
QueryBuilder<User, User, QDistinct> distinctByProfileImagePath(
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
@@ -1706,12 +1534,6 @@ extension UserQueryProperty on QueryBuilder<User, User, QQueryProperty> {
});
}
QueryBuilder<User, String, QQueryOperations> firstNameProperty() {
return QueryBuilder.apply(this, (query) {
return query.addPropertyName(r'firstName');
});
}
QueryBuilder<User, String, QQueryOperations> idProperty() {
return QueryBuilder.apply(this, (query) {
return query.addPropertyName(r'id');
@@ -1742,18 +1564,18 @@ extension UserQueryProperty on QueryBuilder<User, User, QQueryProperty> {
});
}
QueryBuilder<User, String, QQueryOperations> lastNameProperty() {
return QueryBuilder.apply(this, (query) {
return query.addPropertyName(r'lastName');
});
}
QueryBuilder<User, bool?, QQueryOperations> memoryEnabledProperty() {
return QueryBuilder.apply(this, (query) {
return query.addPropertyName(r'memoryEnabled');
});
}
QueryBuilder<User, String, QQueryOperations> nameProperty() {
return QueryBuilder.apply(this, (query) {
return query.addPropertyName(r'name');
});
}
QueryBuilder<User, String, QQueryOperations> profileImagePathProperty() {
return QueryBuilder.apply(this, (query) {
return query.addPropertyName(r'profileImagePath');
@@ -132,7 +132,7 @@ class AppBarProfileInfoBox extends HookConsumerWidget {
),
),
title: Text(
"${authState.firstName} ${authState.lastName}",
authState.name,
style: TextStyle(
color: context.primaryColor,
fontWeight: FontWeight.bold,
+2 -3
View File
@@ -7,8 +7,7 @@ import 'package:immich_mobile/shared/models/user.dart';
Widget userAvatar(BuildContext context, User u, {double? radius}) {
final url =
"${Store.get(StoreKey.serverEndpoint)}/user/profile-image/${u.id}";
final firstNameFirstLetter = u.firstName.isNotEmpty ? u.firstName[0] : "";
final lastNameFirstLetter = u.lastName.isNotEmpty ? u.lastName[0] : "";
final nameFirstLetter = u.name.isNotEmpty ? u.name[0] : "";
return CircleAvatar(
radius: radius,
backgroundColor: context.primaryColor.withAlpha(50),
@@ -19,6 +18,6 @@ Widget userAvatar(BuildContext context, User u, {double? radius}) {
),
// silence errors if user has no profile image, use initials as fallback
onForegroundImageError: (exception, stackTrace) {},
child: Text((firstNameFirstLetter + lastNameFirstLetter).toUpperCase()),
child: Text(nameFirstLetter.toUpperCase()),
);
}
+1 -1
View File
@@ -43,7 +43,7 @@ class UserCircleAvatar extends ConsumerWidget {
'${Store.get(StoreKey.serverEndpoint)}/user/profile-image/${user.id}?d=${Random().nextInt(1024)}';
final textIcon = Text(
user.firstName[0].toUpperCase(),
user.name[0].toUpperCase(),
style: TextStyle(
fontWeight: FontWeight.bold,
color: context.isDarkTheme ? Colors.black : Colors.white,
+1 -2
View File
@@ -10,9 +10,8 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**email** | **String** | |
**externalPath** | **String** | | [optional]
**firstName** | **String** | |
**lastName** | **String** | |
**memoriesEnabled** | **bool** | | [optional]
**name** | **String** | |
**password** | **String** | |
**storageLabel** | **String** | | [optional]
+1 -2
View File
@@ -9,9 +9,8 @@ import 'package:openapi/api.dart';
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**accessToken** | **String** | |
**firstName** | **String** | |
**isAdmin** | **bool** | |
**lastName** | **String** | |
**name** | **String** | |
**profileImagePath** | **String** | |
**shouldChangePassword** | **bool** | |
**userEmail** | **String** | |
+1 -2
View File
@@ -12,12 +12,11 @@ Name | Type | Description | Notes
**deletedAt** | [**DateTime**](DateTime.md) | |
**email** | **String** | |
**externalPath** | **String** | |
**firstName** | **String** | |
**id** | **String** | |
**inTimeline** | **bool** | | [optional]
**isAdmin** | **bool** | |
**lastName** | **String** | |
**memoriesEnabled** | **bool** | | [optional]
**name** | **String** | |
**oauthId** | **String** | |
**profileImagePath** | **String** | |
**shouldChangePassword** | **bool** | |
+1 -2
View File
@@ -9,8 +9,7 @@ import 'package:openapi/api.dart';
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**email** | **String** | |
**firstName** | **String** | |
**lastName** | **String** | |
**name** | **String** | |
**password** | **String** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+1 -2
View File
@@ -10,11 +10,10 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**email** | **String** | | [optional]
**externalPath** | **String** | | [optional]
**firstName** | **String** | | [optional]
**id** | **String** | |
**isAdmin** | **bool** | | [optional]
**lastName** | **String** | | [optional]
**memoriesEnabled** | **bool** | | [optional]
**name** | **String** | | [optional]
**password** | **String** | | [optional]
**shouldChangePassword** | **bool** | | [optional]
**storageLabel** | **String** | | [optional]
+1 -2
View File
@@ -10,9 +10,8 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**photos** | **int** | |
**usage** | **int** | |
**userFirstName** | **String** | |
**userId** | **String** | |
**userLastName** | **String** | |
**userName** | **String** | |
**videos** | **int** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+1 -2
View File
@@ -9,9 +9,8 @@ import 'package:openapi/api.dart';
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**email** | **String** | |
**firstName** | **String** | |
**id** | **String** | |
**lastName** | **String** | |
**name** | **String** | |
**profileImagePath** | **String** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+1 -2
View File
@@ -12,11 +12,10 @@ Name | Type | Description | Notes
**deletedAt** | [**DateTime**](DateTime.md) | |
**email** | **String** | |
**externalPath** | **String** | |
**firstName** | **String** | |
**id** | **String** | |
**isAdmin** | **bool** | |
**lastName** | **String** | |
**memoriesEnabled** | **bool** | | [optional]
**name** | **String** | |
**oauthId** | **String** | |
**profileImagePath** | **String** | |
**shouldChangePassword** | **bool** | |
+9 -17
View File
@@ -15,9 +15,8 @@ class CreateUserDto {
CreateUserDto({
required this.email,
this.externalPath,
required this.firstName,
required this.lastName,
this.memoriesEnabled,
required this.name,
required this.password,
this.storageLabel,
});
@@ -26,10 +25,6 @@ class CreateUserDto {
String? externalPath;
String firstName;
String lastName;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
@@ -38,6 +33,8 @@ class CreateUserDto {
///
bool? memoriesEnabled;
String name;
String password;
String? storageLabel;
@@ -46,9 +43,8 @@ class CreateUserDto {
bool operator ==(Object other) => identical(this, other) || other is CreateUserDto &&
other.email == email &&
other.externalPath == externalPath &&
other.firstName == firstName &&
other.lastName == lastName &&
other.memoriesEnabled == memoriesEnabled &&
other.name == name &&
other.password == password &&
other.storageLabel == storageLabel;
@@ -57,14 +53,13 @@ class CreateUserDto {
// ignore: unnecessary_parenthesis
(email.hashCode) +
(externalPath == null ? 0 : externalPath!.hashCode) +
(firstName.hashCode) +
(lastName.hashCode) +
(memoriesEnabled == null ? 0 : memoriesEnabled!.hashCode) +
(name.hashCode) +
(password.hashCode) +
(storageLabel == null ? 0 : storageLabel!.hashCode);
@override
String toString() => 'CreateUserDto[email=$email, externalPath=$externalPath, firstName=$firstName, lastName=$lastName, memoriesEnabled=$memoriesEnabled, password=$password, storageLabel=$storageLabel]';
String toString() => 'CreateUserDto[email=$email, externalPath=$externalPath, memoriesEnabled=$memoriesEnabled, name=$name, password=$password, storageLabel=$storageLabel]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -74,13 +69,12 @@ class CreateUserDto {
} else {
// json[r'externalPath'] = null;
}
json[r'firstName'] = this.firstName;
json[r'lastName'] = this.lastName;
if (this.memoriesEnabled != null) {
json[r'memoriesEnabled'] = this.memoriesEnabled;
} else {
// json[r'memoriesEnabled'] = null;
}
json[r'name'] = this.name;
json[r'password'] = this.password;
if (this.storageLabel != null) {
json[r'storageLabel'] = this.storageLabel;
@@ -100,9 +94,8 @@ class CreateUserDto {
return CreateUserDto(
email: mapValueOfType<String>(json, r'email')!,
externalPath: mapValueOfType<String>(json, r'externalPath'),
firstName: mapValueOfType<String>(json, r'firstName')!,
lastName: mapValueOfType<String>(json, r'lastName')!,
memoriesEnabled: mapValueOfType<bool>(json, r'memoriesEnabled'),
name: mapValueOfType<String>(json, r'name')!,
password: mapValueOfType<String>(json, r'password')!,
storageLabel: mapValueOfType<String>(json, r'storageLabel'),
);
@@ -153,8 +146,7 @@ class CreateUserDto {
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'email',
'firstName',
'lastName',
'name',
'password',
};
}
+8 -16
View File
@@ -14,9 +14,8 @@ class LoginResponseDto {
/// Returns a new [LoginResponseDto] instance.
LoginResponseDto({
required this.accessToken,
required this.firstName,
required this.isAdmin,
required this.lastName,
required this.name,
required this.profileImagePath,
required this.shouldChangePassword,
required this.userEmail,
@@ -25,11 +24,9 @@ class LoginResponseDto {
String accessToken;
String firstName;
bool isAdmin;
String lastName;
String name;
String profileImagePath;
@@ -42,9 +39,8 @@ class LoginResponseDto {
@override
bool operator ==(Object other) => identical(this, other) || other is LoginResponseDto &&
other.accessToken == accessToken &&
other.firstName == firstName &&
other.isAdmin == isAdmin &&
other.lastName == lastName &&
other.name == name &&
other.profileImagePath == profileImagePath &&
other.shouldChangePassword == shouldChangePassword &&
other.userEmail == userEmail &&
@@ -54,23 +50,21 @@ class LoginResponseDto {
int get hashCode =>
// ignore: unnecessary_parenthesis
(accessToken.hashCode) +
(firstName.hashCode) +
(isAdmin.hashCode) +
(lastName.hashCode) +
(name.hashCode) +
(profileImagePath.hashCode) +
(shouldChangePassword.hashCode) +
(userEmail.hashCode) +
(userId.hashCode);
@override
String toString() => 'LoginResponseDto[accessToken=$accessToken, firstName=$firstName, isAdmin=$isAdmin, lastName=$lastName, profileImagePath=$profileImagePath, shouldChangePassword=$shouldChangePassword, userEmail=$userEmail, userId=$userId]';
String toString() => 'LoginResponseDto[accessToken=$accessToken, isAdmin=$isAdmin, name=$name, profileImagePath=$profileImagePath, shouldChangePassword=$shouldChangePassword, userEmail=$userEmail, userId=$userId]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'accessToken'] = this.accessToken;
json[r'firstName'] = this.firstName;
json[r'isAdmin'] = this.isAdmin;
json[r'lastName'] = this.lastName;
json[r'name'] = this.name;
json[r'profileImagePath'] = this.profileImagePath;
json[r'shouldChangePassword'] = this.shouldChangePassword;
json[r'userEmail'] = this.userEmail;
@@ -87,9 +81,8 @@ class LoginResponseDto {
return LoginResponseDto(
accessToken: mapValueOfType<String>(json, r'accessToken')!,
firstName: mapValueOfType<String>(json, r'firstName')!,
isAdmin: mapValueOfType<bool>(json, r'isAdmin')!,
lastName: mapValueOfType<String>(json, r'lastName')!,
name: mapValueOfType<String>(json, r'name')!,
profileImagePath: mapValueOfType<String>(json, r'profileImagePath')!,
shouldChangePassword: mapValueOfType<bool>(json, r'shouldChangePassword')!,
userEmail: mapValueOfType<String>(json, r'userEmail')!,
@@ -142,9 +135,8 @@ class LoginResponseDto {
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'accessToken',
'firstName',
'isAdmin',
'lastName',
'name',
'profileImagePath',
'shouldChangePassword',
'userEmail',
+9 -17
View File
@@ -17,12 +17,11 @@ class PartnerResponseDto {
required this.deletedAt,
required this.email,
required this.externalPath,
required this.firstName,
required this.id,
this.inTimeline,
required this.isAdmin,
required this.lastName,
this.memoriesEnabled,
required this.name,
required this.oauthId,
required this.profileImagePath,
required this.shouldChangePassword,
@@ -38,8 +37,6 @@ class PartnerResponseDto {
String? externalPath;
String firstName;
String id;
///
@@ -52,8 +49,6 @@ class PartnerResponseDto {
bool isAdmin;
String lastName;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
@@ -62,6 +57,8 @@ class PartnerResponseDto {
///
bool? memoriesEnabled;
String name;
String oauthId;
String profileImagePath;
@@ -78,12 +75,11 @@ class PartnerResponseDto {
other.deletedAt == deletedAt &&
other.email == email &&
other.externalPath == externalPath &&
other.firstName == firstName &&
other.id == id &&
other.inTimeline == inTimeline &&
other.isAdmin == isAdmin &&
other.lastName == lastName &&
other.memoriesEnabled == memoriesEnabled &&
other.name == name &&
other.oauthId == oauthId &&
other.profileImagePath == profileImagePath &&
other.shouldChangePassword == shouldChangePassword &&
@@ -97,12 +93,11 @@ class PartnerResponseDto {
(deletedAt == null ? 0 : deletedAt!.hashCode) +
(email.hashCode) +
(externalPath == null ? 0 : externalPath!.hashCode) +
(firstName.hashCode) +
(id.hashCode) +
(inTimeline == null ? 0 : inTimeline!.hashCode) +
(isAdmin.hashCode) +
(lastName.hashCode) +
(memoriesEnabled == null ? 0 : memoriesEnabled!.hashCode) +
(name.hashCode) +
(oauthId.hashCode) +
(profileImagePath.hashCode) +
(shouldChangePassword.hashCode) +
@@ -110,7 +105,7 @@ class PartnerResponseDto {
(updatedAt.hashCode);
@override
String toString() => 'PartnerResponseDto[createdAt=$createdAt, deletedAt=$deletedAt, email=$email, externalPath=$externalPath, firstName=$firstName, id=$id, inTimeline=$inTimeline, isAdmin=$isAdmin, lastName=$lastName, memoriesEnabled=$memoriesEnabled, oauthId=$oauthId, profileImagePath=$profileImagePath, shouldChangePassword=$shouldChangePassword, storageLabel=$storageLabel, updatedAt=$updatedAt]';
String toString() => 'PartnerResponseDto[createdAt=$createdAt, deletedAt=$deletedAt, email=$email, externalPath=$externalPath, id=$id, inTimeline=$inTimeline, isAdmin=$isAdmin, memoriesEnabled=$memoriesEnabled, name=$name, oauthId=$oauthId, profileImagePath=$profileImagePath, shouldChangePassword=$shouldChangePassword, storageLabel=$storageLabel, updatedAt=$updatedAt]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -126,7 +121,6 @@ class PartnerResponseDto {
} else {
// json[r'externalPath'] = null;
}
json[r'firstName'] = this.firstName;
json[r'id'] = this.id;
if (this.inTimeline != null) {
json[r'inTimeline'] = this.inTimeline;
@@ -134,12 +128,12 @@ class PartnerResponseDto {
// json[r'inTimeline'] = null;
}
json[r'isAdmin'] = this.isAdmin;
json[r'lastName'] = this.lastName;
if (this.memoriesEnabled != null) {
json[r'memoriesEnabled'] = this.memoriesEnabled;
} else {
// json[r'memoriesEnabled'] = null;
}
json[r'name'] = this.name;
json[r'oauthId'] = this.oauthId;
json[r'profileImagePath'] = this.profileImagePath;
json[r'shouldChangePassword'] = this.shouldChangePassword;
@@ -164,12 +158,11 @@ class PartnerResponseDto {
deletedAt: mapDateTime(json, r'deletedAt', ''),
email: mapValueOfType<String>(json, r'email')!,
externalPath: mapValueOfType<String>(json, r'externalPath'),
firstName: mapValueOfType<String>(json, r'firstName')!,
id: mapValueOfType<String>(json, r'id')!,
inTimeline: mapValueOfType<bool>(json, r'inTimeline'),
isAdmin: mapValueOfType<bool>(json, r'isAdmin')!,
lastName: mapValueOfType<String>(json, r'lastName')!,
memoriesEnabled: mapValueOfType<bool>(json, r'memoriesEnabled'),
name: mapValueOfType<String>(json, r'name')!,
oauthId: mapValueOfType<String>(json, r'oauthId')!,
profileImagePath: mapValueOfType<String>(json, r'profileImagePath')!,
shouldChangePassword: mapValueOfType<bool>(json, r'shouldChangePassword')!,
@@ -226,10 +219,9 @@ class PartnerResponseDto {
'deletedAt',
'email',
'externalPath',
'firstName',
'id',
'isAdmin',
'lastName',
'name',
'oauthId',
'profileImagePath',
'shouldChangePassword',
+8 -16
View File
@@ -14,42 +14,36 @@ class SignUpDto {
/// Returns a new [SignUpDto] instance.
SignUpDto({
required this.email,
required this.firstName,
required this.lastName,
required this.name,
required this.password,
});
String email;
String firstName;
String lastName;
String name;
String password;
@override
bool operator ==(Object other) => identical(this, other) || other is SignUpDto &&
other.email == email &&
other.firstName == firstName &&
other.lastName == lastName &&
other.name == name &&
other.password == password;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(email.hashCode) +
(firstName.hashCode) +
(lastName.hashCode) +
(name.hashCode) +
(password.hashCode);
@override
String toString() => 'SignUpDto[email=$email, firstName=$firstName, lastName=$lastName, password=$password]';
String toString() => 'SignUpDto[email=$email, name=$name, password=$password]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'email'] = this.email;
json[r'firstName'] = this.firstName;
json[r'lastName'] = this.lastName;
json[r'name'] = this.name;
json[r'password'] = this.password;
return json;
}
@@ -63,8 +57,7 @@ class SignUpDto {
return SignUpDto(
email: mapValueOfType<String>(json, r'email')!,
firstName: mapValueOfType<String>(json, r'firstName')!,
lastName: mapValueOfType<String>(json, r'lastName')!,
name: mapValueOfType<String>(json, r'name')!,
password: mapValueOfType<String>(json, r'password')!,
);
}
@@ -114,8 +107,7 @@ class SignUpDto {
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'email',
'firstName',
'lastName',
'name',
'password',
};
}
+12 -29
View File
@@ -15,11 +15,10 @@ class UpdateUserDto {
UpdateUserDto({
this.email,
this.externalPath,
this.firstName,
required this.id,
this.isAdmin,
this.lastName,
this.memoriesEnabled,
this.name,
this.password,
this.shouldChangePassword,
this.storageLabel,
@@ -41,14 +40,6 @@ class UpdateUserDto {
///
String? externalPath;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? firstName;
String id;
///
@@ -65,7 +56,7 @@ class UpdateUserDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? lastName;
bool? memoriesEnabled;
///
/// Please note: This property should have been non-nullable! Since the specification file
@@ -73,7 +64,7 @@ class UpdateUserDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? memoriesEnabled;
String? name;
///
/// Please note: This property should have been non-nullable! Since the specification file
@@ -103,11 +94,10 @@ class UpdateUserDto {
bool operator ==(Object other) => identical(this, other) || other is UpdateUserDto &&
other.email == email &&
other.externalPath == externalPath &&
other.firstName == firstName &&
other.id == id &&
other.isAdmin == isAdmin &&
other.lastName == lastName &&
other.memoriesEnabled == memoriesEnabled &&
other.name == name &&
other.password == password &&
other.shouldChangePassword == shouldChangePassword &&
other.storageLabel == storageLabel;
@@ -117,17 +107,16 @@ class UpdateUserDto {
// ignore: unnecessary_parenthesis
(email == null ? 0 : email!.hashCode) +
(externalPath == null ? 0 : externalPath!.hashCode) +
(firstName == null ? 0 : firstName!.hashCode) +
(id.hashCode) +
(isAdmin == null ? 0 : isAdmin!.hashCode) +
(lastName == null ? 0 : lastName!.hashCode) +
(memoriesEnabled == null ? 0 : memoriesEnabled!.hashCode) +
(name == null ? 0 : name!.hashCode) +
(password == null ? 0 : password!.hashCode) +
(shouldChangePassword == null ? 0 : shouldChangePassword!.hashCode) +
(storageLabel == null ? 0 : storageLabel!.hashCode);
@override
String toString() => 'UpdateUserDto[email=$email, externalPath=$externalPath, firstName=$firstName, id=$id, isAdmin=$isAdmin, lastName=$lastName, memoriesEnabled=$memoriesEnabled, password=$password, shouldChangePassword=$shouldChangePassword, storageLabel=$storageLabel]';
String toString() => 'UpdateUserDto[email=$email, externalPath=$externalPath, id=$id, isAdmin=$isAdmin, memoriesEnabled=$memoriesEnabled, name=$name, password=$password, shouldChangePassword=$shouldChangePassword, storageLabel=$storageLabel]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -140,11 +129,6 @@ class UpdateUserDto {
json[r'externalPath'] = this.externalPath;
} else {
// json[r'externalPath'] = null;
}
if (this.firstName != null) {
json[r'firstName'] = this.firstName;
} else {
// json[r'firstName'] = null;
}
json[r'id'] = this.id;
if (this.isAdmin != null) {
@@ -152,16 +136,16 @@ class UpdateUserDto {
} else {
// json[r'isAdmin'] = null;
}
if (this.lastName != null) {
json[r'lastName'] = this.lastName;
} else {
// json[r'lastName'] = null;
}
if (this.memoriesEnabled != null) {
json[r'memoriesEnabled'] = this.memoriesEnabled;
} else {
// json[r'memoriesEnabled'] = null;
}
if (this.name != null) {
json[r'name'] = this.name;
} else {
// json[r'name'] = null;
}
if (this.password != null) {
json[r'password'] = this.password;
} else {
@@ -190,11 +174,10 @@ class UpdateUserDto {
return UpdateUserDto(
email: mapValueOfType<String>(json, r'email'),
externalPath: mapValueOfType<String>(json, r'externalPath'),
firstName: mapValueOfType<String>(json, r'firstName'),
id: mapValueOfType<String>(json, r'id')!,
isAdmin: mapValueOfType<bool>(json, r'isAdmin'),
lastName: mapValueOfType<String>(json, r'lastName'),
memoriesEnabled: mapValueOfType<bool>(json, r'memoriesEnabled'),
name: mapValueOfType<String>(json, r'name'),
password: mapValueOfType<String>(json, r'password'),
shouldChangePassword: mapValueOfType<bool>(json, r'shouldChangePassword'),
storageLabel: mapValueOfType<String>(json, r'storageLabel'),
+8 -16
View File
@@ -15,9 +15,8 @@ class UsageByUserDto {
UsageByUserDto({
required this.photos,
required this.usage,
required this.userFirstName,
required this.userId,
required this.userLastName,
required this.userName,
required this.videos,
});
@@ -25,11 +24,9 @@ class UsageByUserDto {
int usage;
String userFirstName;
String userId;
String userLastName;
String userName;
int videos;
@@ -37,9 +34,8 @@ class UsageByUserDto {
bool operator ==(Object other) => identical(this, other) || other is UsageByUserDto &&
other.photos == photos &&
other.usage == usage &&
other.userFirstName == userFirstName &&
other.userId == userId &&
other.userLastName == userLastName &&
other.userName == userName &&
other.videos == videos;
@override
@@ -47,21 +43,19 @@ class UsageByUserDto {
// ignore: unnecessary_parenthesis
(photos.hashCode) +
(usage.hashCode) +
(userFirstName.hashCode) +
(userId.hashCode) +
(userLastName.hashCode) +
(userName.hashCode) +
(videos.hashCode);
@override
String toString() => 'UsageByUserDto[photos=$photos, usage=$usage, userFirstName=$userFirstName, userId=$userId, userLastName=$userLastName, videos=$videos]';
String toString() => 'UsageByUserDto[photos=$photos, usage=$usage, userId=$userId, userName=$userName, videos=$videos]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'photos'] = this.photos;
json[r'usage'] = this.usage;
json[r'userFirstName'] = this.userFirstName;
json[r'userId'] = this.userId;
json[r'userLastName'] = this.userLastName;
json[r'userName'] = this.userName;
json[r'videos'] = this.videos;
return json;
}
@@ -76,9 +70,8 @@ class UsageByUserDto {
return UsageByUserDto(
photos: mapValueOfType<int>(json, r'photos')!,
usage: mapValueOfType<int>(json, r'usage')!,
userFirstName: mapValueOfType<String>(json, r'userFirstName')!,
userId: mapValueOfType<String>(json, r'userId')!,
userLastName: mapValueOfType<String>(json, r'userLastName')!,
userName: mapValueOfType<String>(json, r'userName')!,
videos: mapValueOfType<int>(json, r'videos')!,
);
}
@@ -129,9 +122,8 @@ class UsageByUserDto {
static const requiredKeys = <String>{
'photos',
'usage',
'userFirstName',
'userId',
'userLastName',
'userName',
'videos',
};
}
+8 -16
View File
@@ -14,48 +14,42 @@ class UserDto {
/// Returns a new [UserDto] instance.
UserDto({
required this.email,
required this.firstName,
required this.id,
required this.lastName,
required this.name,
required this.profileImagePath,
});
String email;
String firstName;
String id;
String lastName;
String name;
String profileImagePath;
@override
bool operator ==(Object other) => identical(this, other) || other is UserDto &&
other.email == email &&
other.firstName == firstName &&
other.id == id &&
other.lastName == lastName &&
other.name == name &&
other.profileImagePath == profileImagePath;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(email.hashCode) +
(firstName.hashCode) +
(id.hashCode) +
(lastName.hashCode) +
(name.hashCode) +
(profileImagePath.hashCode);
@override
String toString() => 'UserDto[email=$email, firstName=$firstName, id=$id, lastName=$lastName, profileImagePath=$profileImagePath]';
String toString() => 'UserDto[email=$email, id=$id, name=$name, profileImagePath=$profileImagePath]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'email'] = this.email;
json[r'firstName'] = this.firstName;
json[r'id'] = this.id;
json[r'lastName'] = this.lastName;
json[r'name'] = this.name;
json[r'profileImagePath'] = this.profileImagePath;
return json;
}
@@ -69,9 +63,8 @@ class UserDto {
return UserDto(
email: mapValueOfType<String>(json, r'email')!,
firstName: mapValueOfType<String>(json, r'firstName')!,
id: mapValueOfType<String>(json, r'id')!,
lastName: mapValueOfType<String>(json, r'lastName')!,
name: mapValueOfType<String>(json, r'name')!,
profileImagePath: mapValueOfType<String>(json, r'profileImagePath')!,
);
}
@@ -121,9 +114,8 @@ class UserDto {
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'email',
'firstName',
'id',
'lastName',
'name',
'profileImagePath',
};
}
+9 -17
View File
@@ -17,11 +17,10 @@ class UserResponseDto {
required this.deletedAt,
required this.email,
required this.externalPath,
required this.firstName,
required this.id,
required this.isAdmin,
required this.lastName,
this.memoriesEnabled,
required this.name,
required this.oauthId,
required this.profileImagePath,
required this.shouldChangePassword,
@@ -37,14 +36,10 @@ class UserResponseDto {
String? externalPath;
String firstName;
String id;
bool isAdmin;
String lastName;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
@@ -53,6 +48,8 @@ class UserResponseDto {
///
bool? memoriesEnabled;
String name;
String oauthId;
String profileImagePath;
@@ -69,11 +66,10 @@ class UserResponseDto {
other.deletedAt == deletedAt &&
other.email == email &&
other.externalPath == externalPath &&
other.firstName == firstName &&
other.id == id &&
other.isAdmin == isAdmin &&
other.lastName == lastName &&
other.memoriesEnabled == memoriesEnabled &&
other.name == name &&
other.oauthId == oauthId &&
other.profileImagePath == profileImagePath &&
other.shouldChangePassword == shouldChangePassword &&
@@ -87,11 +83,10 @@ class UserResponseDto {
(deletedAt == null ? 0 : deletedAt!.hashCode) +
(email.hashCode) +
(externalPath == null ? 0 : externalPath!.hashCode) +
(firstName.hashCode) +
(id.hashCode) +
(isAdmin.hashCode) +
(lastName.hashCode) +
(memoriesEnabled == null ? 0 : memoriesEnabled!.hashCode) +
(name.hashCode) +
(oauthId.hashCode) +
(profileImagePath.hashCode) +
(shouldChangePassword.hashCode) +
@@ -99,7 +94,7 @@ class UserResponseDto {
(updatedAt.hashCode);
@override
String toString() => 'UserResponseDto[createdAt=$createdAt, deletedAt=$deletedAt, email=$email, externalPath=$externalPath, firstName=$firstName, id=$id, isAdmin=$isAdmin, lastName=$lastName, memoriesEnabled=$memoriesEnabled, oauthId=$oauthId, profileImagePath=$profileImagePath, shouldChangePassword=$shouldChangePassword, storageLabel=$storageLabel, updatedAt=$updatedAt]';
String toString() => 'UserResponseDto[createdAt=$createdAt, deletedAt=$deletedAt, email=$email, externalPath=$externalPath, id=$id, isAdmin=$isAdmin, memoriesEnabled=$memoriesEnabled, name=$name, oauthId=$oauthId, profileImagePath=$profileImagePath, shouldChangePassword=$shouldChangePassword, storageLabel=$storageLabel, updatedAt=$updatedAt]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -115,15 +110,14 @@ class UserResponseDto {
} else {
// json[r'externalPath'] = null;
}
json[r'firstName'] = this.firstName;
json[r'id'] = this.id;
json[r'isAdmin'] = this.isAdmin;
json[r'lastName'] = this.lastName;
if (this.memoriesEnabled != null) {
json[r'memoriesEnabled'] = this.memoriesEnabled;
} else {
// json[r'memoriesEnabled'] = null;
}
json[r'name'] = this.name;
json[r'oauthId'] = this.oauthId;
json[r'profileImagePath'] = this.profileImagePath;
json[r'shouldChangePassword'] = this.shouldChangePassword;
@@ -148,11 +142,10 @@ class UserResponseDto {
deletedAt: mapDateTime(json, r'deletedAt', ''),
email: mapValueOfType<String>(json, r'email')!,
externalPath: mapValueOfType<String>(json, r'externalPath'),
firstName: mapValueOfType<String>(json, r'firstName')!,
id: mapValueOfType<String>(json, r'id')!,
isAdmin: mapValueOfType<bool>(json, r'isAdmin')!,
lastName: mapValueOfType<String>(json, r'lastName')!,
memoriesEnabled: mapValueOfType<bool>(json, r'memoriesEnabled'),
name: mapValueOfType<String>(json, r'name')!,
oauthId: mapValueOfType<String>(json, r'oauthId')!,
profileImagePath: mapValueOfType<String>(json, r'profileImagePath')!,
shouldChangePassword: mapValueOfType<bool>(json, r'shouldChangePassword')!,
@@ -209,10 +202,9 @@ class UserResponseDto {
'deletedAt',
'email',
'externalPath',
'firstName',
'id',
'isAdmin',
'lastName',
'name',
'oauthId',
'profileImagePath',
'shouldChangePassword',
+5 -10
View File
@@ -26,21 +26,16 @@ void main() {
// TODO
});
// String firstName
test('to test the property `firstName`', () async {
// TODO
});
// String lastName
test('to test the property `lastName`', () async {
// TODO
});
// bool memoriesEnabled
test('to test the property `memoriesEnabled`', () async {
// TODO
});
// String name
test('to test the property `name`', () async {
// TODO
});
// String password
test('to test the property `password`', () async {
// TODO
+2 -7
View File
@@ -21,18 +21,13 @@ void main() {
// TODO
});
// String firstName
test('to test the property `firstName`', () async {
// TODO
});
// bool isAdmin
test('to test the property `isAdmin`', () async {
// TODO
});
// String lastName
test('to test the property `lastName`', () async {
// String name
test('to test the property `name`', () async {
// TODO
});
+4 -9
View File
@@ -36,11 +36,6 @@ void main() {
// TODO
});
// String firstName
test('to test the property `firstName`', () async {
// TODO
});
// String id
test('to test the property `id`', () async {
// TODO
@@ -56,13 +51,13 @@ void main() {
// TODO
});
// String lastName
test('to test the property `lastName`', () async {
// bool memoriesEnabled
test('to test the property `memoriesEnabled`', () async {
// TODO
});
// bool memoriesEnabled
test('to test the property `memoriesEnabled`', () async {
// String name
test('to test the property `name`', () async {
// TODO
});
+2 -7
View File
@@ -21,13 +21,8 @@ void main() {
// TODO
});
// String firstName
test('to test the property `firstName`', () async {
// TODO
});
// String lastName
test('to test the property `lastName`', () async {
// String name
test('to test the property `name`', () async {
// TODO
});
+4 -9
View File
@@ -26,11 +26,6 @@ void main() {
// TODO
});
// String firstName
test('to test the property `firstName`', () async {
// TODO
});
// String id
test('to test the property `id`', () async {
// TODO
@@ -41,13 +36,13 @@ void main() {
// TODO
});
// String lastName
test('to test the property `lastName`', () async {
// bool memoriesEnabled
test('to test the property `memoriesEnabled`', () async {
// TODO
});
// bool memoriesEnabled
test('to test the property `memoriesEnabled`', () async {
// String name
test('to test the property `name`', () async {
// TODO
});
+2 -7
View File
@@ -26,18 +26,13 @@ void main() {
// TODO
});
// String userFirstName
test('to test the property `userFirstName`', () async {
// TODO
});
// String userId
test('to test the property `userId`', () async {
// TODO
});
// String userLastName
test('to test the property `userLastName`', () async {
// String userName
test('to test the property `userName`', () async {
// TODO
});
+2 -7
View File
@@ -21,18 +21,13 @@ void main() {
// TODO
});
// String firstName
test('to test the property `firstName`', () async {
// TODO
});
// String id
test('to test the property `id`', () async {
// TODO
});
// String lastName
test('to test the property `lastName`', () async {
// String name
test('to test the property `name`', () async {
// TODO
});
+4 -9
View File
@@ -36,11 +36,6 @@ void main() {
// TODO
});
// String firstName
test('to test the property `firstName`', () async {
// TODO
});
// String id
test('to test the property `id`', () async {
// TODO
@@ -51,13 +46,13 @@ void main() {
// TODO
});
// String lastName
test('to test the property `lastName`', () async {
// bool memoriesEnabled
test('to test the property `memoriesEnabled`', () async {
// TODO
});
// bool memoriesEnabled
test('to test the property `memoriesEnabled`', () async {
// String name
test('to test the property `name`', () async {
// TODO
});
+1 -2
View File
@@ -62,8 +62,7 @@ void main() {
id: "1",
updatedAt: DateTime.now(),
email: "a@b.c",
firstName: "first",
lastName: "last",
name: "first last",
isAdmin: false,
);
setUpAll(() async {