mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
The lints are regrouped and sorted. Also, added the following new lints: - unnecessary_ignore - parameter_assignments - avoid_unused_constructor_parameters - tighten_type_of_initializing_formals - only_throw_errors - deprecated_consistency - unnecessary_statements
45 lines
1.1 KiB
Dart
45 lines
1.1 KiB
Dart
import 'package:immich_mobile/domain/models/user.model.dart';
|
|
|
|
import '../../utils.dart';
|
|
|
|
class UserFactory {
|
|
const UserFactory();
|
|
|
|
static User create({
|
|
String? id,
|
|
String? name,
|
|
String? email,
|
|
DateTime? profileChangedAt,
|
|
bool? hasProfileImage,
|
|
AvatarColor? avatarColor,
|
|
}) {
|
|
final userId = TestUtils.uuid(id);
|
|
return User(
|
|
id: userId,
|
|
name: name ?? 'user_$userId',
|
|
email: email ?? '$userId@test.com',
|
|
profileChangedAt: TestUtils.date(profileChangedAt),
|
|
hasProfileImage: hasProfileImage ?? false,
|
|
avatarColor: avatarColor ?? .primary,
|
|
);
|
|
}
|
|
|
|
static UserDto createDto({
|
|
String? id,
|
|
String? name,
|
|
String? email,
|
|
DateTime? profileChangedAt,
|
|
bool? hasProfileImage,
|
|
AvatarColor? avatarColor,
|
|
}) {
|
|
final userId = TestUtils.uuid(id);
|
|
return UserDto(
|
|
id: userId,
|
|
name: name ?? 'user_$userId',
|
|
email: email ?? '$userId@test.com',
|
|
profileChangedAt: TestUtils.date(profileChangedAt),
|
|
hasProfileImage: hasProfileImage ?? false,
|
|
avatarColor: avatarColor ?? .primary,
|
|
);
|
|
}
|
|
}
|