mirror of
https://github.com/immich-app/immich.git
synced 2025-12-17 01:11:13 +03:00
chore: bump dart sdk to 3.8 (#20355)
* chore: bump dart sdk to 3.8 * chore: make build * make pigeon * chore: format files --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
@@ -7,15 +7,9 @@ class AlbumAddAssetsResponse {
|
||||
List<String> alreadyInAlbum;
|
||||
int successfullyAdded;
|
||||
|
||||
AlbumAddAssetsResponse({
|
||||
required this.alreadyInAlbum,
|
||||
required this.successfullyAdded,
|
||||
});
|
||||
AlbumAddAssetsResponse({required this.alreadyInAlbum, required this.successfullyAdded});
|
||||
|
||||
AlbumAddAssetsResponse copyWith({
|
||||
List<String>? alreadyInAlbum,
|
||||
int? successfullyAdded,
|
||||
}) {
|
||||
AlbumAddAssetsResponse copyWith({List<String>? alreadyInAlbum, int? successfullyAdded}) {
|
||||
return AlbumAddAssetsResponse(
|
||||
alreadyInAlbum: alreadyInAlbum ?? this.alreadyInAlbum,
|
||||
successfullyAdded: successfullyAdded ?? this.successfullyAdded,
|
||||
@@ -23,10 +17,7 @@ class AlbumAddAssetsResponse {
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return <String, dynamic>{
|
||||
'alreadyInAlbum': alreadyInAlbum,
|
||||
'successfullyAdded': successfullyAdded,
|
||||
};
|
||||
return <String, dynamic>{'alreadyInAlbum': alreadyInAlbum, 'successfullyAdded': successfullyAdded};
|
||||
}
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
@@ -1,5 +1 @@
|
||||
enum QuickFilterMode {
|
||||
all,
|
||||
sharedWithMe,
|
||||
myAlbums,
|
||||
}
|
||||
enum QuickFilterMode { all, sharedWithMe, myAlbums }
|
||||
|
||||
@@ -11,11 +11,7 @@ class AlbumViewerPageState {
|
||||
required this.editDescriptionText,
|
||||
});
|
||||
|
||||
AlbumViewerPageState copyWith({
|
||||
bool? isEditAlbum,
|
||||
String? editTitleText,
|
||||
String? editDescriptionText,
|
||||
}) {
|
||||
AlbumViewerPageState copyWith({bool? isEditAlbum, String? editTitleText, String? editDescriptionText}) {
|
||||
return AlbumViewerPageState(
|
||||
isEditAlbum: isEditAlbum ?? this.isEditAlbum,
|
||||
editTitleText: editTitleText ?? this.editTitleText,
|
||||
|
||||
@@ -4,9 +4,7 @@ import 'package:immich_mobile/entities/asset.entity.dart';
|
||||
class AssetSelectionPageResult {
|
||||
final Set<Asset> selectedAssets;
|
||||
|
||||
const AssetSelectionPageResult({
|
||||
required this.selectedAssets,
|
||||
});
|
||||
const AssetSelectionPageResult({required this.selectedAssets});
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) return true;
|
||||
|
||||
@@ -13,12 +13,7 @@ class AssetSelectionState {
|
||||
this.selectedCount = 0,
|
||||
});
|
||||
|
||||
AssetSelectionState copyWith({
|
||||
bool? hasRemote,
|
||||
bool? hasLocal,
|
||||
bool? hasMerged,
|
||||
int? selectedCount,
|
||||
}) {
|
||||
AssetSelectionState copyWith({bool? hasRemote, bool? hasLocal, bool? hasMerged, int? selectedCount}) {
|
||||
return AssetSelectionState(
|
||||
hasRemote: hasRemote ?? this.hasRemote,
|
||||
hasLocal: hasLocal ?? this.hasLocal,
|
||||
@@ -28,10 +23,10 @@ class AssetSelectionState {
|
||||
}
|
||||
|
||||
AssetSelectionState.fromSelection(Set<Asset> selection)
|
||||
: hasLocal = selection.any((e) => e.storage == AssetState.local),
|
||||
hasMerged = selection.any((e) => e.storage == AssetState.merged),
|
||||
hasRemote = selection.any((e) => e.storage == AssetState.remote),
|
||||
selectedCount = selection.length;
|
||||
: hasLocal = selection.any((e) => e.storage == AssetState.local),
|
||||
hasMerged = selection.any((e) => e.storage == AssetState.merged),
|
||||
hasRemote = selection.any((e) => e.storage == AssetState.remote),
|
||||
selectedCount = selection.length;
|
||||
|
||||
@override
|
||||
String toString() =>
|
||||
|
||||
@@ -5,19 +5,10 @@ class AuxilaryEndpoint {
|
||||
final String url;
|
||||
final AuxCheckStatus status;
|
||||
|
||||
const AuxilaryEndpoint({
|
||||
required this.url,
|
||||
required this.status,
|
||||
});
|
||||
const AuxilaryEndpoint({required this.url, required this.status});
|
||||
|
||||
AuxilaryEndpoint copyWith({
|
||||
String? url,
|
||||
AuxCheckStatus? status,
|
||||
}) {
|
||||
return AuxilaryEndpoint(
|
||||
url: url ?? this.url,
|
||||
status: status ?? this.status,
|
||||
);
|
||||
AuxilaryEndpoint copyWith({String? url, AuxCheckStatus? status}) {
|
||||
return AuxilaryEndpoint(url: url ?? this.url, status: status ?? this.status);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -34,10 +25,7 @@ class AuxilaryEndpoint {
|
||||
int get hashCode => url.hashCode ^ status.hashCode;
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return <String, dynamic>{
|
||||
'url': url,
|
||||
'status': status.toMap(),
|
||||
};
|
||||
return <String, dynamic>{'url': url, 'status': status.toMap()};
|
||||
}
|
||||
|
||||
factory AuxilaryEndpoint.fromMap(Map<String, dynamic> map) {
|
||||
@@ -55,9 +43,7 @@ class AuxilaryEndpoint {
|
||||
|
||||
class AuxCheckStatus {
|
||||
final String name;
|
||||
const AuxCheckStatus({
|
||||
required this.name,
|
||||
});
|
||||
const AuxCheckStatus({required this.name});
|
||||
const AuxCheckStatus._(this.name);
|
||||
|
||||
static const loading = AuxCheckStatus._('loading');
|
||||
@@ -75,24 +61,16 @@ class AuxCheckStatus {
|
||||
@override
|
||||
int get hashCode => name.hashCode;
|
||||
|
||||
AuxCheckStatus copyWith({
|
||||
String? name,
|
||||
}) {
|
||||
return AuxCheckStatus(
|
||||
name: name ?? this.name,
|
||||
);
|
||||
AuxCheckStatus copyWith({String? name}) {
|
||||
return AuxCheckStatus(name: name ?? this.name);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return <String, dynamic>{
|
||||
'name': name,
|
||||
};
|
||||
return <String, dynamic>{'name': name};
|
||||
}
|
||||
|
||||
factory AuxCheckStatus.fromMap(Map<String, dynamic> map) {
|
||||
return AuxCheckStatus(
|
||||
name: map['name'] as String,
|
||||
);
|
||||
return AuxCheckStatus(name: map['name'] as String);
|
||||
}
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
@@ -5,18 +5,12 @@ class BiometricStatus {
|
||||
final List<BiometricType> availableBiometrics;
|
||||
final bool canAuthenticate;
|
||||
|
||||
const BiometricStatus({
|
||||
required this.availableBiometrics,
|
||||
required this.canAuthenticate,
|
||||
});
|
||||
const BiometricStatus({required this.availableBiometrics, required this.canAuthenticate});
|
||||
|
||||
@override
|
||||
String toString() => 'BiometricStatus(availableBiometrics: $availableBiometrics, canAuthenticate: $canAuthenticate)';
|
||||
|
||||
BiometricStatus copyWith({
|
||||
List<BiometricType>? availableBiometrics,
|
||||
bool? canAuthenticate,
|
||||
}) {
|
||||
BiometricStatus copyWith({List<BiometricType>? availableBiometrics, bool? canAuthenticate}) {
|
||||
return BiometricStatus(
|
||||
availableBiometrics: availableBiometrics ?? this.availableBiometrics,
|
||||
canAuthenticate: canAuthenticate ?? this.canAuthenticate,
|
||||
|
||||
@@ -4,17 +4,9 @@ class AvailableAlbum {
|
||||
final Album album;
|
||||
final int assetCount;
|
||||
final DateTime? lastBackup;
|
||||
const AvailableAlbum({
|
||||
required this.album,
|
||||
required this.assetCount,
|
||||
this.lastBackup,
|
||||
});
|
||||
const AvailableAlbum({required this.album, required this.assetCount, this.lastBackup});
|
||||
|
||||
AvailableAlbum copyWith({
|
||||
Album? album,
|
||||
int? assetCount,
|
||||
DateTime? lastBackup,
|
||||
}) {
|
||||
AvailableAlbum copyWith({Album? album, int? assetCount, DateTime? lastBackup}) {
|
||||
return AvailableAlbum(
|
||||
album: album ?? this.album,
|
||||
assetCount: assetCount ?? this.assetCount,
|
||||
|
||||
@@ -148,10 +148,7 @@ class BackUpState {
|
||||
collectionEquals(other.selectedBackupAlbums, selectedBackupAlbums) &&
|
||||
collectionEquals(other.excludedBackupAlbums, excludedBackupAlbums) &&
|
||||
collectionEquals(other.allUniqueAssets, allUniqueAssets) &&
|
||||
collectionEquals(
|
||||
other.selectedAlbumsBackupAssetsIds,
|
||||
selectedAlbumsBackupAssetsIds,
|
||||
) &&
|
||||
collectionEquals(other.selectedAlbumsBackupAssetsIds, selectedAlbumsBackupAssetsIds) &&
|
||||
other.currentUploadAsset == currentUploadAsset;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,17 +5,9 @@ class SuccessUploadAsset {
|
||||
final String remoteAssetId;
|
||||
final bool isDuplicate;
|
||||
|
||||
const SuccessUploadAsset({
|
||||
required this.candidate,
|
||||
required this.remoteAssetId,
|
||||
required this.isDuplicate,
|
||||
});
|
||||
const SuccessUploadAsset({required this.candidate, required this.remoteAssetId, required this.isDuplicate});
|
||||
|
||||
SuccessUploadAsset copyWith({
|
||||
BackupCandidate? candidate,
|
||||
String? remoteAssetId,
|
||||
bool? isDuplicate,
|
||||
}) {
|
||||
SuccessUploadAsset copyWith({BackupCandidate? candidate, String? remoteAssetId, bool? isDuplicate}) {
|
||||
return SuccessUploadAsset(
|
||||
candidate: candidate ?? this.candidate,
|
||||
remoteAssetId: remoteAssetId ?? this.remoteAssetId,
|
||||
|
||||
@@ -10,17 +10,9 @@ class DownloadInfo {
|
||||
// enum
|
||||
final TaskStatus status;
|
||||
|
||||
const DownloadInfo({
|
||||
required this.fileName,
|
||||
required this.progress,
|
||||
required this.status,
|
||||
});
|
||||
const DownloadInfo({required this.fileName, required this.progress, required this.status});
|
||||
|
||||
DownloadInfo copyWith({
|
||||
String? fileName,
|
||||
double? progress,
|
||||
TaskStatus? status,
|
||||
}) {
|
||||
DownloadInfo copyWith({String? fileName, double? progress, TaskStatus? status}) {
|
||||
return DownloadInfo(
|
||||
fileName: fileName ?? this.fileName,
|
||||
progress: progress ?? this.progress,
|
||||
@@ -29,11 +21,7 @@ class DownloadInfo {
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return <String, dynamic>{
|
||||
'fileName': fileName,
|
||||
'progress': progress,
|
||||
'status': status.index,
|
||||
};
|
||||
return <String, dynamic>{'fileName': fileName, 'progress': progress, 'status': status.index};
|
||||
}
|
||||
|
||||
factory DownloadInfo.fromMap(Map<String, dynamic> map) {
|
||||
@@ -67,17 +55,9 @@ class DownloadState {
|
||||
final TaskStatus downloadStatus;
|
||||
final Map<String, DownloadInfo> taskProgress;
|
||||
final bool showProgress;
|
||||
const DownloadState({
|
||||
required this.downloadStatus,
|
||||
required this.taskProgress,
|
||||
required this.showProgress,
|
||||
});
|
||||
const DownloadState({required this.downloadStatus, required this.taskProgress, required this.showProgress});
|
||||
|
||||
DownloadState copyWith({
|
||||
TaskStatus? downloadStatus,
|
||||
Map<String, DownloadInfo>? taskProgress,
|
||||
bool? showProgress,
|
||||
}) {
|
||||
DownloadState copyWith({TaskStatus? downloadStatus, Map<String, DownloadInfo>? taskProgress, bool? showProgress}) {
|
||||
return DownloadState(
|
||||
downloadStatus: downloadStatus ?? this.downloadStatus,
|
||||
taskProgress: taskProgress ?? this.taskProgress,
|
||||
|
||||
@@ -1,43 +1,25 @@
|
||||
// ignore_for_file: public_member_api_docs, sort_constructors_first
|
||||
import 'dart:convert';
|
||||
|
||||
enum LivePhotosPart {
|
||||
video,
|
||||
image,
|
||||
}
|
||||
enum LivePhotosPart { video, image }
|
||||
|
||||
class LivePhotosMetadata {
|
||||
// enum
|
||||
LivePhotosPart part;
|
||||
|
||||
String id;
|
||||
LivePhotosMetadata({
|
||||
required this.part,
|
||||
required this.id,
|
||||
});
|
||||
LivePhotosMetadata({required this.part, required this.id});
|
||||
|
||||
LivePhotosMetadata copyWith({
|
||||
LivePhotosPart? part,
|
||||
String? id,
|
||||
}) {
|
||||
return LivePhotosMetadata(
|
||||
part: part ?? this.part,
|
||||
id: id ?? this.id,
|
||||
);
|
||||
LivePhotosMetadata copyWith({LivePhotosPart? part, String? id}) {
|
||||
return LivePhotosMetadata(part: part ?? this.part, id: id ?? this.id);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return <String, dynamic>{
|
||||
'part': part.index,
|
||||
'id': id,
|
||||
};
|
||||
return <String, dynamic>{'part': part.index, 'id': id};
|
||||
}
|
||||
|
||||
factory LivePhotosMetadata.fromMap(Map<String, dynamic> map) {
|
||||
return LivePhotosMetadata(
|
||||
part: LivePhotosPart.values[map['part'] as int],
|
||||
id: map['id'] as String,
|
||||
);
|
||||
return LivePhotosMetadata(part: LivePhotosPart.values[map['part'] as int], id: map['id'] as String);
|
||||
}
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
@@ -3,9 +3,5 @@ import 'package:immich_mobile/models/folder/root_folder.model.dart';
|
||||
class RecursiveFolder extends RootFolder {
|
||||
final String name;
|
||||
|
||||
const RecursiveFolder({
|
||||
required this.name,
|
||||
required super.path,
|
||||
required super.subfolders,
|
||||
});
|
||||
const RecursiveFolder({required this.name, required super.path, required super.subfolders});
|
||||
}
|
||||
|
||||
@@ -4,8 +4,5 @@ class RootFolder {
|
||||
final List<RecursiveFolder> subfolders;
|
||||
final String path;
|
||||
|
||||
const RootFolder({
|
||||
required this.subfolders,
|
||||
required this.path,
|
||||
});
|
||||
const RootFolder({required this.subfolders, required this.path});
|
||||
}
|
||||
|
||||
@@ -4,24 +4,13 @@ import 'package:openapi/api.dart';
|
||||
class MapMarker {
|
||||
final LatLng latLng;
|
||||
final String assetRemoteId;
|
||||
const MapMarker({
|
||||
required this.latLng,
|
||||
required this.assetRemoteId,
|
||||
});
|
||||
const MapMarker({required this.latLng, required this.assetRemoteId});
|
||||
|
||||
MapMarker copyWith({
|
||||
LatLng? latLng,
|
||||
String? assetRemoteId,
|
||||
}) {
|
||||
return MapMarker(
|
||||
latLng: latLng ?? this.latLng,
|
||||
assetRemoteId: assetRemoteId ?? this.assetRemoteId,
|
||||
);
|
||||
MapMarker copyWith({LatLng? latLng, String? assetRemoteId}) {
|
||||
return MapMarker(latLng: latLng ?? this.latLng, assetRemoteId: assetRemoteId ?? this.assetRemoteId);
|
||||
}
|
||||
|
||||
MapMarker.fromDto(MapMarkerResponseDto dto)
|
||||
: latLng = LatLng(dto.lat, dto.lon),
|
||||
assetRemoteId = dto.id;
|
||||
MapMarker.fromDto(MapMarkerResponseDto dto) : latLng = LatLng(dto.lat, dto.lon), assetRemoteId = dto.id;
|
||||
|
||||
@override
|
||||
String toString() => 'MapMarker(latLng: $latLng, assetRemoteId: $assetRemoteId)';
|
||||
|
||||
@@ -7,19 +7,10 @@ import 'package:immich_mobile/entities/asset.entity.dart';
|
||||
class Memory {
|
||||
final String title;
|
||||
final List<Asset> assets;
|
||||
const Memory({
|
||||
required this.title,
|
||||
required this.assets,
|
||||
});
|
||||
const Memory({required this.title, required this.assets});
|
||||
|
||||
Memory copyWith({
|
||||
String? title,
|
||||
List<Asset>? assets,
|
||||
}) {
|
||||
return Memory(
|
||||
title: title ?? this.title,
|
||||
assets: assets ?? this.assets,
|
||||
);
|
||||
Memory copyWith({String? title, List<Asset>? assets}) {
|
||||
return Memory(title: title ?? this.title, assets: assets ?? this.assets);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -14,30 +14,14 @@ class SearchCuratedContent {
|
||||
/// The id to lookup the asset from the server
|
||||
final String id;
|
||||
|
||||
const SearchCuratedContent({
|
||||
required this.label,
|
||||
required this.id,
|
||||
this.subtitle,
|
||||
});
|
||||
const SearchCuratedContent({required this.label, required this.id, this.subtitle});
|
||||
|
||||
SearchCuratedContent copyWith({
|
||||
String? label,
|
||||
String? subtitle,
|
||||
String? id,
|
||||
}) {
|
||||
return SearchCuratedContent(
|
||||
label: label ?? this.label,
|
||||
subtitle: subtitle ?? this.subtitle,
|
||||
id: id ?? this.id,
|
||||
);
|
||||
SearchCuratedContent copyWith({String? label, String? subtitle, String? id}) {
|
||||
return SearchCuratedContent(label: label ?? this.label, subtitle: subtitle ?? this.subtitle, id: id ?? this.id);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return <String, dynamic>{
|
||||
'label': label,
|
||||
'subtitle': subtitle,
|
||||
'id': id,
|
||||
};
|
||||
return <String, dynamic>{'label': label, 'subtitle': subtitle, 'id': id};
|
||||
}
|
||||
|
||||
factory SearchCuratedContent.fromMap(Map<String, dynamic> map) {
|
||||
|
||||
@@ -8,30 +8,14 @@ class SearchLocationFilter {
|
||||
String? country;
|
||||
String? state;
|
||||
String? city;
|
||||
SearchLocationFilter({
|
||||
this.country,
|
||||
this.state,
|
||||
this.city,
|
||||
});
|
||||
SearchLocationFilter({this.country, this.state, this.city});
|
||||
|
||||
SearchLocationFilter copyWith({
|
||||
String? country,
|
||||
String? state,
|
||||
String? city,
|
||||
}) {
|
||||
return SearchLocationFilter(
|
||||
country: country ?? this.country,
|
||||
state: state ?? this.state,
|
||||
city: city ?? this.city,
|
||||
);
|
||||
SearchLocationFilter copyWith({String? country, String? state, String? city}) {
|
||||
return SearchLocationFilter(country: country ?? this.country, state: state ?? this.state, city: city ?? this.city);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return <String, dynamic>{
|
||||
'country': country,
|
||||
'state': state,
|
||||
'city': city,
|
||||
};
|
||||
return <String, dynamic>{'country': country, 'state': state, 'city': city};
|
||||
}
|
||||
|
||||
factory SearchLocationFilter.fromMap(Map<String, dynamic> map) {
|
||||
@@ -64,26 +48,14 @@ class SearchLocationFilter {
|
||||
class SearchCameraFilter {
|
||||
String? make;
|
||||
String? model;
|
||||
SearchCameraFilter({
|
||||
this.make,
|
||||
this.model,
|
||||
});
|
||||
SearchCameraFilter({this.make, this.model});
|
||||
|
||||
SearchCameraFilter copyWith({
|
||||
String? make,
|
||||
String? model,
|
||||
}) {
|
||||
return SearchCameraFilter(
|
||||
make: make ?? this.make,
|
||||
model: model ?? this.model,
|
||||
);
|
||||
SearchCameraFilter copyWith({String? make, String? model}) {
|
||||
return SearchCameraFilter(make: make ?? this.make, model: model ?? this.model);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return <String, dynamic>{
|
||||
'make': make,
|
||||
'model': model,
|
||||
};
|
||||
return <String, dynamic>{'make': make, 'model': model};
|
||||
}
|
||||
|
||||
factory SearchCameraFilter.fromMap(Map<String, dynamic> map) {
|
||||
@@ -115,19 +87,10 @@ class SearchCameraFilter {
|
||||
class SearchDateFilter {
|
||||
DateTime? takenBefore;
|
||||
DateTime? takenAfter;
|
||||
SearchDateFilter({
|
||||
this.takenBefore,
|
||||
this.takenAfter,
|
||||
});
|
||||
SearchDateFilter({this.takenBefore, this.takenAfter});
|
||||
|
||||
SearchDateFilter copyWith({
|
||||
DateTime? takenBefore,
|
||||
DateTime? takenAfter,
|
||||
}) {
|
||||
return SearchDateFilter(
|
||||
takenBefore: takenBefore ?? this.takenBefore,
|
||||
takenAfter: takenAfter ?? this.takenAfter,
|
||||
);
|
||||
SearchDateFilter copyWith({DateTime? takenBefore, DateTime? takenAfter}) {
|
||||
return SearchDateFilter(takenBefore: takenBefore ?? this.takenBefore, takenAfter: takenAfter ?? this.takenAfter);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
@@ -167,17 +130,9 @@ class SearchDisplayFilters {
|
||||
bool isNotInAlbum = false;
|
||||
bool isArchive = false;
|
||||
bool isFavorite = false;
|
||||
SearchDisplayFilters({
|
||||
required this.isNotInAlbum,
|
||||
required this.isArchive,
|
||||
required this.isFavorite,
|
||||
});
|
||||
SearchDisplayFilters({required this.isNotInAlbum, required this.isArchive, required this.isFavorite});
|
||||
|
||||
SearchDisplayFilters copyWith({
|
||||
bool? isNotInAlbum,
|
||||
bool? isArchive,
|
||||
bool? isFavorite,
|
||||
}) {
|
||||
SearchDisplayFilters copyWith({bool? isNotInAlbum, bool? isArchive, bool? isFavorite}) {
|
||||
return SearchDisplayFilters(
|
||||
isNotInAlbum: isNotInAlbum ?? this.isNotInAlbum,
|
||||
isArchive: isArchive ?? this.isArchive,
|
||||
@@ -186,11 +141,7 @@ class SearchDisplayFilters {
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return <String, dynamic>{
|
||||
'isNotInAlbum': isNotInAlbum,
|
||||
'isArchive': isArchive,
|
||||
'isFavorite': isFavorite,
|
||||
};
|
||||
return <String, dynamic>{'isNotInAlbum': isNotInAlbum, 'isArchive': isArchive, 'isFavorite': isFavorite};
|
||||
}
|
||||
|
||||
factory SearchDisplayFilters.fromMap(Map<String, dynamic> map) {
|
||||
|
||||
@@ -6,19 +6,10 @@ class SearchResult {
|
||||
final List<Asset> assets;
|
||||
final int? nextPage;
|
||||
|
||||
const SearchResult({
|
||||
required this.assets,
|
||||
this.nextPage,
|
||||
});
|
||||
const SearchResult({required this.assets, this.nextPage});
|
||||
|
||||
SearchResult copyWith({
|
||||
List<Asset>? assets,
|
||||
int? nextPage,
|
||||
}) {
|
||||
return SearchResult(
|
||||
assets: assets ?? this.assets,
|
||||
nextPage: nextPage ?? this.nextPage,
|
||||
);
|
||||
SearchResult copyWith({List<Asset>? assets, int? nextPage}) {
|
||||
return SearchResult(assets: assets ?? this.assets, nextPage: nextPage ?? this.nextPage);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -15,11 +15,7 @@ class ServerConfig {
|
||||
required this.mapLightStyleUrl,
|
||||
});
|
||||
|
||||
ServerConfig copyWith({
|
||||
int? trashDays,
|
||||
String? oauthButtonText,
|
||||
String? externalDomain,
|
||||
}) {
|
||||
ServerConfig copyWith({int? trashDays, String? oauthButtonText, String? externalDomain}) {
|
||||
return ServerConfig(
|
||||
trashDays: trashDays ?? this.trashDays,
|
||||
oauthButtonText: oauthButtonText ?? this.oauthButtonText,
|
||||
@@ -34,11 +30,11 @@ class ServerConfig {
|
||||
'ServerConfig(trashDays: $trashDays, oauthButtonText: $oauthButtonText, externalDomain: $externalDomain)';
|
||||
|
||||
ServerConfig.fromDto(ServerConfigDto dto)
|
||||
: trashDays = dto.trashDays,
|
||||
oauthButtonText = dto.oauthButtonText,
|
||||
externalDomain = dto.externalDomain,
|
||||
mapDarkStyleUrl = dto.mapDarkStyleUrl,
|
||||
mapLightStyleUrl = dto.mapLightStyleUrl;
|
||||
: trashDays = dto.trashDays,
|
||||
oauthButtonText = dto.oauthButtonText,
|
||||
externalDomain = dto.externalDomain,
|
||||
mapDarkStyleUrl = dto.mapDarkStyleUrl,
|
||||
mapLightStyleUrl = dto.mapLightStyleUrl;
|
||||
|
||||
@override
|
||||
bool operator ==(covariant ServerConfig other) {
|
||||
|
||||
@@ -13,12 +13,7 @@ class ServerDiskInfo {
|
||||
required this.diskUsagePercentage,
|
||||
});
|
||||
|
||||
ServerDiskInfo copyWith({
|
||||
String? diskAvailable,
|
||||
String? diskSize,
|
||||
String? diskUse,
|
||||
double? diskUsagePercentage,
|
||||
}) {
|
||||
ServerDiskInfo copyWith({String? diskAvailable, String? diskSize, String? diskUse, double? diskUsagePercentage}) {
|
||||
return ServerDiskInfo(
|
||||
diskAvailable: diskAvailable ?? this.diskAvailable,
|
||||
diskSize: diskSize ?? this.diskSize,
|
||||
@@ -33,10 +28,10 @@ class ServerDiskInfo {
|
||||
}
|
||||
|
||||
ServerDiskInfo.fromDto(ServerStorageResponseDto dto)
|
||||
: diskAvailable = dto.diskAvailable,
|
||||
diskSize = dto.diskSize,
|
||||
diskUse = dto.diskUse,
|
||||
diskUsagePercentage = dto.diskUsagePercentage;
|
||||
: diskAvailable = dto.diskAvailable,
|
||||
diskSize = dto.diskSize,
|
||||
diskUse = dto.diskUse,
|
||||
diskUsagePercentage = dto.diskUsagePercentage;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
|
||||
@@ -13,12 +13,7 @@ class ServerFeatures {
|
||||
required this.passwordLogin,
|
||||
});
|
||||
|
||||
ServerFeatures copyWith({
|
||||
bool? trash,
|
||||
bool? map,
|
||||
bool? oauthEnabled,
|
||||
bool? passwordLogin,
|
||||
}) {
|
||||
ServerFeatures copyWith({bool? trash, bool? map, bool? oauthEnabled, bool? passwordLogin}) {
|
||||
return ServerFeatures(
|
||||
trash: trash ?? this.trash,
|
||||
map: map ?? this.map,
|
||||
@@ -33,10 +28,10 @@ class ServerFeatures {
|
||||
}
|
||||
|
||||
ServerFeatures.fromDto(ServerFeaturesDto dto)
|
||||
: trash = dto.trash,
|
||||
map = dto.map,
|
||||
oauthEnabled = dto.oauth,
|
||||
passwordLogin = dto.passwordLogin;
|
||||
: trash = dto.trash,
|
||||
map = dto.map,
|
||||
oauthEnabled = dto.oauth,
|
||||
passwordLogin = dto.passwordLogin;
|
||||
|
||||
@override
|
||||
bool operator ==(covariant ServerFeatures other) {
|
||||
|
||||
@@ -5,22 +5,10 @@ class ServerVersion {
|
||||
final int minor;
|
||||
final int patch;
|
||||
|
||||
const ServerVersion({
|
||||
required this.major,
|
||||
required this.minor,
|
||||
required this.patch,
|
||||
});
|
||||
const ServerVersion({required this.major, required this.minor, required this.patch});
|
||||
|
||||
ServerVersion copyWith({
|
||||
int? major,
|
||||
int? minor,
|
||||
int? patch,
|
||||
}) {
|
||||
return ServerVersion(
|
||||
major: major ?? this.major,
|
||||
minor: minor ?? this.minor,
|
||||
patch: patch ?? this.patch,
|
||||
);
|
||||
ServerVersion copyWith({int? major, int? minor, int? patch}) {
|
||||
return ServerVersion(major: major ?? this.major, minor: minor ?? this.minor, patch: patch ?? this.patch);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -28,10 +16,7 @@ class ServerVersion {
|
||||
return 'ServerVersion(major: $major, minor: $minor, patch: $patch)';
|
||||
}
|
||||
|
||||
ServerVersion.fromDto(ServerVersionResponseDto dto)
|
||||
: major = dto.major,
|
||||
minor = dto.minor,
|
||||
patch = dto.patch_;
|
||||
ServerVersion.fromDto(ServerVersionResponseDto dto) : major = dto.major, minor = dto.minor, patch = dto.patch_;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
|
||||
@@ -58,23 +58,23 @@ class SharedLink {
|
||||
}
|
||||
|
||||
SharedLink.fromDto(SharedLinkResponseDto dto)
|
||||
: id = dto.id,
|
||||
allowDownload = dto.allowDownload,
|
||||
allowUpload = dto.allowUpload,
|
||||
description = dto.description,
|
||||
password = dto.password,
|
||||
expiresAt = dto.expiresAt,
|
||||
key = dto.key,
|
||||
showMetadata = dto.showMetadata,
|
||||
type = dto.type == SharedLinkType.ALBUM ? SharedLinkSource.album : SharedLinkSource.individual,
|
||||
title = dto.type == SharedLinkType.ALBUM
|
||||
? dto.album?.albumName.toUpperCase() ?? "UNKNOWN SHARE"
|
||||
: "INDIVIDUAL SHARE",
|
||||
thumbAssetId = dto.type == SharedLinkType.ALBUM
|
||||
? dto.album?.albumThumbnailAssetId
|
||||
: dto.assets.isNotEmpty
|
||||
? dto.assets[0].id
|
||||
: null;
|
||||
: id = dto.id,
|
||||
allowDownload = dto.allowDownload,
|
||||
allowUpload = dto.allowUpload,
|
||||
description = dto.description,
|
||||
password = dto.password,
|
||||
expiresAt = dto.expiresAt,
|
||||
key = dto.key,
|
||||
showMetadata = dto.showMetadata,
|
||||
type = dto.type == SharedLinkType.ALBUM ? SharedLinkSource.album : SharedLinkSource.individual,
|
||||
title = dto.type == SharedLinkType.ALBUM
|
||||
? dto.album?.albumName.toUpperCase() ?? "UNKNOWN SHARE"
|
||||
: "INDIVIDUAL SHARE",
|
||||
thumbAssetId = dto.type == SharedLinkType.ALBUM
|
||||
? dto.album?.albumThumbnailAssetId
|
||||
: dto.assets.isNotEmpty
|
||||
? dto.assets[0].id
|
||||
: null;
|
||||
|
||||
@override
|
||||
String toString() =>
|
||||
|
||||
@@ -5,21 +5,9 @@ import 'dart:io';
|
||||
import 'package:immich_mobile/utils/bytes_units.dart';
|
||||
import 'package:path/path.dart';
|
||||
|
||||
enum ShareIntentAttachmentType {
|
||||
image,
|
||||
video,
|
||||
}
|
||||
enum ShareIntentAttachmentType { image, video }
|
||||
|
||||
enum UploadStatus {
|
||||
enqueued,
|
||||
running,
|
||||
complete,
|
||||
notFound,
|
||||
failed,
|
||||
canceled,
|
||||
waitingToRetry,
|
||||
paused,
|
||||
}
|
||||
enum UploadStatus { enqueued, running, complete, notFound, failed, canceled, waitingToRetry, paused }
|
||||
|
||||
class ShareIntentAttachment {
|
||||
final String path;
|
||||
@@ -90,9 +78,8 @@ class ShareIntentAttachment {
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory ShareIntentAttachment.fromJson(String source) => ShareIntentAttachment.fromMap(
|
||||
json.decode(source) as Map<String, dynamic>,
|
||||
);
|
||||
factory ShareIntentAttachment.fromJson(String source) =>
|
||||
ShareIntentAttachment.fromMap(json.decode(source) as Map<String, dynamic>);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
|
||||
Reference in New Issue
Block a user