app/lib/common/rust/downloader.dart

65 lines
1.8 KiB
Dart
Raw Normal View History

2024-02-06 20:19:53 +08:00
// This file is automatically generated, so please do not edit it.
2024-02-15 21:24:39 +08:00
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.24.
2024-02-06 20:19:53 +08:00
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
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 'downloader.freezed.dart';
class DownloadCallbackData {
final String id;
final int total;
final int progress;
final int speed;
final MyDownloaderStatus status;
const DownloadCallbackData({
required this.id,
required this.total,
required this.progress,
required this.speed,
required this.status,
});
@override
int get hashCode =>
id.hashCode ^
total.hashCode ^
progress.hashCode ^
speed.hashCode ^
status.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is DownloadCallbackData &&
runtimeType == other.runtimeType &&
id == other.id &&
total == other.total &&
progress == other.progress &&
speed == other.speed &&
status == other.status;
}
@freezed
sealed class MyDownloaderStatus with _$MyDownloaderStatus {
const factory MyDownloaderStatus.noStart() = MyDownloaderStatus_NoStart;
const factory MyDownloaderStatus.running() = MyDownloaderStatus_Running;
const factory MyDownloaderStatus.pending(
MyNetworkItemPendingType field0,
) = MyDownloaderStatus_Pending;
const factory MyDownloaderStatus.error(
String field0,
) = MyDownloaderStatus_Error;
const factory MyDownloaderStatus.finished() = MyDownloaderStatus_Finished;
}
enum MyNetworkItemPendingType {
queueUp,
starting,
stopping,
initializing,
}