diff --git a/app/lib/rust/api/logging.dart b/app/lib/rust/api/logging.dart index fdf2d9ca..2bf90ab5 100644 --- a/app/lib/rust/api/logging.dart +++ b/app/lib/rust/api/logging.dart @@ -6,5 +6,4 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; import 'package:localsend_app/rust/frb_generated.dart'; -Future enableDebugLogging() => - RustLib.instance.api.crateApiLoggingEnableDebugLogging(); +Future enableDebugLogging() => RustLib.instance.api.crateApiLoggingEnableDebugLogging(); diff --git a/app/lib/rust/api/model.dart b/app/lib/rust/api/model.dart index ae93e57e..753d7d8f 100644 --- a/app/lib/rust/api/model.dart +++ b/app/lib/rust/api/model.dart @@ -34,14 +34,7 @@ class FileDto { }); @override - int get hashCode => - id.hashCode ^ - fileName.hashCode ^ - size.hashCode ^ - fileType.hashCode ^ - sha256.hashCode ^ - preview.hashCode ^ - metadata.hashCode; + int get hashCode => id.hashCode ^ fileName.hashCode ^ size.hashCode ^ fileType.hashCode ^ sha256.hashCode ^ preview.hashCode ^ metadata.hashCode; @override bool operator ==(Object other) => @@ -71,144 +64,7 @@ class FileMetadata { @override bool operator ==(Object other) => - identical(this, other) || - other is FileMetadata && - runtimeType == other.runtimeType && - modified == other.modified && - accessed == other.accessed; -} - -class PrepareUploadRequestDto { - final RegisterDto info; - final Map files; - - const PrepareUploadRequestDto({ - required this.info, - required this.files, - }); - - @override - int get hashCode => info.hashCode ^ files.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is PrepareUploadRequestDto && - runtimeType == other.runtimeType && - info == other.info && - files == other.files; -} - -class PrepareUploadResponseDto { - final String sessionId; - final Map files; - - const PrepareUploadResponseDto({ - required this.sessionId, - required this.files, - }); - - @override - int get hashCode => sessionId.hashCode ^ files.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is PrepareUploadResponseDto && - runtimeType == other.runtimeType && - sessionId == other.sessionId && - files == other.files; -} - -enum ProtocolType { - http, - https, -} - -class RegisterDto { - final String alias; - final String version; - final String? deviceModel; - final DeviceType? deviceType; - final String token; - final int port; - final ProtocolType protocol; - final bool hasWebInterface; - - const RegisterDto({ - required this.alias, - required this.version, - this.deviceModel, - this.deviceType, - required this.token, - required this.port, - required this.protocol, - required this.hasWebInterface, - }); - - @override - int get hashCode => - alias.hashCode ^ - version.hashCode ^ - deviceModel.hashCode ^ - deviceType.hashCode ^ - token.hashCode ^ - port.hashCode ^ - protocol.hashCode ^ - hasWebInterface.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is RegisterDto && - runtimeType == other.runtimeType && - alias == other.alias && - version == other.version && - deviceModel == other.deviceModel && - deviceType == other.deviceType && - token == other.token && - port == other.port && - protocol == other.protocol && - hasWebInterface == other.hasWebInterface; -} - -class RegisterResponseDto { - final String alias; - final String version; - final String? deviceModel; - final DeviceType? deviceType; - final String token; - final bool hasWebInterface; - - const RegisterResponseDto({ - required this.alias, - required this.version, - this.deviceModel, - this.deviceType, - required this.token, - required this.hasWebInterface, - }); - - @override - int get hashCode => - alias.hashCode ^ - version.hashCode ^ - deviceModel.hashCode ^ - deviceType.hashCode ^ - token.hashCode ^ - hasWebInterface.hashCode; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is RegisterResponseDto && - runtimeType == other.runtimeType && - alias == other.alias && - version == other.version && - deviceModel == other.deviceModel && - deviceType == other.deviceType && - token == other.token && - hasWebInterface == other.hasWebInterface; + identical(this, other) || other is FileMetadata && runtimeType == other.runtimeType && modified == other.modified && accessed == other.accessed; } class PrepareUploadRequestDto { diff --git a/app/lib/rust/api/webrtc.dart b/app/lib/rust/api/webrtc.dart index 1ae8cd38..f6996c2d 100644 --- a/app/lib/rust/api/webrtc.dart +++ b/app/lib/rust/api/webrtc.dart @@ -109,13 +109,7 @@ class ClientInfo { }); @override - int get hashCode => - id.hashCode ^ - alias.hashCode ^ - version.hashCode ^ - deviceModel.hashCode ^ - deviceType.hashCode ^ - token.hashCode; + int get hashCode => id.hashCode ^ alias.hashCode ^ version.hashCode ^ deviceModel.hashCode ^ deviceType.hashCode ^ token.hashCode; @override bool operator ==(Object other) => @@ -146,12 +140,7 @@ class ClientInfoWithoutId { }); @override - int get hashCode => - alias.hashCode ^ - version.hashCode ^ - deviceModel.hashCode ^ - deviceType.hashCode ^ - token.hashCode; + int get hashCode => alias.hashCode ^ version.hashCode ^ deviceModel.hashCode ^ deviceType.hashCode ^ token.hashCode; @override bool operator ==(Object other) => @@ -181,11 +170,7 @@ class ExpectingPublicKey { @override bool operator ==(Object other) => - identical(this, other) || - other is ExpectingPublicKey && - runtimeType == other.runtimeType && - publicKey == other.publicKey && - kind == other.kind; + identical(this, other) || other is ExpectingPublicKey && runtimeType == other.runtimeType && publicKey == other.publicKey && kind == other.kind; } class PinConfig { @@ -202,11 +187,7 @@ class PinConfig { @override bool operator ==(Object other) => - identical(this, other) || - other is PinConfig && - runtimeType == other.runtimeType && - pin == other.pin && - maxTries == other.maxTries; + identical(this, other) || other is PinConfig && runtimeType == other.runtimeType && pin == other.pin && maxTries == other.maxTries; } class ProposingClientInfo { @@ -223,11 +204,7 @@ class ProposingClientInfo { }); @override - int get hashCode => - alias.hashCode ^ - version.hashCode ^ - deviceModel.hashCode ^ - deviceType.hashCode; + int get hashCode => alias.hashCode ^ version.hashCode ^ deviceModel.hashCode ^ deviceType.hashCode; @override bool operator ==(Object other) => @@ -254,11 +231,7 @@ class RTCFileError { @override bool operator ==(Object other) => - identical(this, other) || - other is RTCFileError && - runtimeType == other.runtimeType && - fileId == other.fileId && - error == other.error; + identical(this, other) || other is RTCFileError && runtimeType == other.runtimeType && fileId == other.fileId && error == other.error; } class RTCSendFileResponse { @@ -278,11 +251,7 @@ class RTCSendFileResponse { @override bool operator ==(Object other) => identical(this, other) || - other is RTCSendFileResponse && - runtimeType == other.runtimeType && - id == other.id && - success == other.success && - error == other.error; + other is RTCSendFileResponse && runtimeType == other.runtimeType && id == other.id && success == other.success && error == other.error; } @freezed @@ -346,9 +315,5 @@ class WsServerSdpMessage { @override bool operator ==(Object other) => identical(this, other) || - other is WsServerSdpMessage && - runtimeType == other.runtimeType && - peer == other.peer && - sessionId == other.sessionId && - sdp == other.sdp; + other is WsServerSdpMessage && runtimeType == other.runtimeType && peer == other.peer && sessionId == other.sessionId && sdp == other.sdp; }