removed unused code
This commit is contained in:
parent
d24e29490f
commit
9d8ea8ee37
|
@ -3,7 +3,6 @@
|
|||
import 'dart:convert';
|
||||
import 'dart:core';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:photos/models/magic_metadata.dart';
|
||||
|
||||
class Collection {
|
||||
|
@ -152,53 +151,6 @@ class Collection {
|
|||
isDeleted: map['isDeleted'] ?? false,
|
||||
);
|
||||
}
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory Collection.fromJson(String source) =>
|
||||
Collection.fromMap(json.decode(source));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Collection(id: $id, owner: $owner, encryptedKey: $encryptedKey, keyDecryptionNonce: $keyDecryptionNonce, name: $name, encryptedName: $encryptedName, nameDecryptionNonce: $nameDecryptionNonce, type: $type, attributes: $attributes, sharees: $sharees, publicURLs: $publicURLs, updationTime: $updationTime, isDeleted: $isDeleted)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object o) {
|
||||
if (identical(this, o)) return true;
|
||||
|
||||
return o is Collection &&
|
||||
o.id == id &&
|
||||
o.owner == owner &&
|
||||
o.encryptedKey == encryptedKey &&
|
||||
o.keyDecryptionNonce == keyDecryptionNonce &&
|
||||
o.name == name &&
|
||||
o.encryptedName == encryptedName &&
|
||||
o.nameDecryptionNonce == nameDecryptionNonce &&
|
||||
o.type == type &&
|
||||
o.attributes == attributes &&
|
||||
listEquals(o.sharees, sharees) &&
|
||||
listEquals(o.publicURLs, publicURLs) &&
|
||||
o.updationTime == updationTime &&
|
||||
o.isDeleted == isDeleted;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
return id.hashCode ^
|
||||
owner.hashCode ^
|
||||
encryptedKey.hashCode ^
|
||||
keyDecryptionNonce.hashCode ^
|
||||
name.hashCode ^
|
||||
encryptedName.hashCode ^
|
||||
nameDecryptionNonce.hashCode ^
|
||||
type.hashCode ^
|
||||
attributes.hashCode ^
|
||||
sharees.hashCode ^
|
||||
publicURLs.hashCode ^
|
||||
updationTime.hashCode ^
|
||||
isDeleted.hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
enum CollectionType {
|
||||
|
@ -218,18 +170,6 @@ class CollectionAttributes {
|
|||
this.version,
|
||||
});
|
||||
|
||||
CollectionAttributes copyWith({
|
||||
String encryptedPath,
|
||||
String pathDecryptionNonce,
|
||||
int version,
|
||||
}) {
|
||||
return CollectionAttributes(
|
||||
encryptedPath: encryptedPath ?? this.encryptedPath,
|
||||
pathDecryptionNonce: pathDecryptionNonce ?? this.pathDecryptionNonce,
|
||||
version: version ?? this.version,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
final map = <String, dynamic>{};
|
||||
if (encryptedPath != null) {
|
||||
|
@ -251,29 +191,6 @@ class CollectionAttributes {
|
|||
version: map['version'] ?? 0,
|
||||
);
|
||||
}
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory CollectionAttributes.fromJson(String source) =>
|
||||
CollectionAttributes.fromMap(json.decode(source));
|
||||
|
||||
@override
|
||||
String toString() =>
|
||||
'CollectionAttributes(encryptedPath: $encryptedPath, pathDecryptionNonce: $pathDecryptionNonce, version: $version)';
|
||||
|
||||
@override
|
||||
bool operator ==(Object o) {
|
||||
if (identical(this, o)) return true;
|
||||
|
||||
return o is CollectionAttributes &&
|
||||
o.encryptedPath == encryptedPath &&
|
||||
o.pathDecryptionNonce == pathDecryptionNonce &&
|
||||
o.version == version;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
encryptedPath.hashCode ^ pathDecryptionNonce.hashCode ^ version.hashCode;
|
||||
}
|
||||
|
||||
class User {
|
||||
|
@ -287,18 +204,6 @@ class User {
|
|||
this.name,
|
||||
});
|
||||
|
||||
User copyWith({
|
||||
int id,
|
||||
String email,
|
||||
String name,
|
||||
}) {
|
||||
return User(
|
||||
id: id ?? this.id,
|
||||
email: email ?? this.email,
|
||||
name: name ?? this.name,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
'id': id,
|
||||
|
@ -320,19 +225,6 @@ class User {
|
|||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory User.fromJson(String source) => User.fromMap(json.decode(source));
|
||||
|
||||
@override
|
||||
String toString() => 'CollectionOwner(id: $id, email: $email, name: $name)';
|
||||
|
||||
@override
|
||||
bool operator ==(Object o) {
|
||||
if (identical(this, o)) return true;
|
||||
|
||||
return o is User && o.id == id && o.email == email && o.name == name;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => id.hashCode ^ email.hashCode ^ name.hashCode;
|
||||
}
|
||||
|
||||
class PublicURL {
|
||||
|
@ -371,33 +263,4 @@ class PublicURL {
|
|||
passwordEnabled: map['passwordEnabled'] ?? false,
|
||||
);
|
||||
}
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory PublicURL.fromJson(String source) =>
|
||||
PublicURL.fromMap(json.decode(source));
|
||||
|
||||
@override
|
||||
String toString() =>
|
||||
'PublicUrl( url: $url, deviceLimit: $deviceLimit, validTill: $validTill, , enableDownload: $enableDownload, , passwordEnabled: $passwordEnabled)';
|
||||
|
||||
@override
|
||||
bool operator ==(Object o) {
|
||||
if (identical(this, o)) return true;
|
||||
|
||||
return o is PublicURL &&
|
||||
o.deviceLimit == deviceLimit &&
|
||||
o.url == url &&
|
||||
o.validTill == validTill &&
|
||||
o.enableDownload == enableDownload &&
|
||||
o.passwordEnabled == passwordEnabled;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
deviceLimit.hashCode ^
|
||||
url.hashCode ^
|
||||
validTill.hashCode ^
|
||||
enableDownload.hashCode ^
|
||||
passwordEnabled.hashCode;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue