This commit is contained in:
2026-02-27 21:12:56 +08:00
commit a878084cbb
233 changed files with 22988 additions and 0 deletions

View File

@@ -0,0 +1,109 @@
// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.11.1.
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
import '../discovery/model.dart';
import '../frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
import 'package:freezed_annotation/freezed_annotation.dart' hide protected;
part 'model.freezed.dart';
enum CanceledBy { sender, receiver }
enum ContentType { file, text, folder }
class Transfer {
final String id;
final double createTime;
final Peer sender;
final String senderIp;
final String fileName;
final double fileSize;
final String savePath;
final TransferStatus status;
final TransferType type;
final ContentType contentType;
final String text;
final String errorMsg;
final String token;
final double progress;
final PlatformInt64 lastReadTime;
final double speed;
const Transfer({
required this.id,
required this.createTime,
required this.sender,
required this.senderIp,
required this.fileName,
required this.fileSize,
required this.savePath,
required this.status,
required this.type,
required this.contentType,
required this.text,
required this.errorMsg,
required this.token,
required this.progress,
required this.lastReadTime,
required this.speed,
});
@override
int get hashCode =>
id.hashCode ^
createTime.hashCode ^
sender.hashCode ^
senderIp.hashCode ^
fileName.hashCode ^
fileSize.hashCode ^
savePath.hashCode ^
status.hashCode ^
type.hashCode ^
contentType.hashCode ^
text.hashCode ^
errorMsg.hashCode ^
token.hashCode ^
progress.hashCode ^
lastReadTime.hashCode ^
speed.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is Transfer &&
runtimeType == other.runtimeType &&
id == other.id &&
createTime == other.createTime &&
sender == other.sender &&
senderIp == other.senderIp &&
fileName == other.fileName &&
fileSize == other.fileSize &&
savePath == other.savePath &&
status == other.status &&
type == other.type &&
contentType == other.contentType &&
text == other.text &&
errorMsg == other.errorMsg &&
token == other.token &&
progress == other.progress &&
lastReadTime == other.lastReadTime &&
speed == other.speed;
}
@freezed
sealed class TransferStatus with _$TransferStatus {
const TransferStatus._();
const factory TransferStatus.pending() = TransferStatus_Pending;
const factory TransferStatus.accepted() = TransferStatus_Accepted;
const factory TransferStatus.rejected() = TransferStatus_Rejected;
const factory TransferStatus.completed() = TransferStatus_Completed;
const factory TransferStatus.error() = TransferStatus_Error;
const factory TransferStatus.canceled(CanceledBy field0) =
TransferStatus_Canceled;
const factory TransferStatus.active() = TransferStatus_Active;
}
enum TransferType { send, receive }