mirror of
https://ghfast.top/https://github.com/StarCitizenToolBox/app.git
synced 2025-07-10 09:44:37 +08:00
Upgrade to flutter_rust_bridge V2
This commit is contained in:
64
lib/common/rust/downloader.dart
Normal file
64
lib/common/rust/downloader.dart
Normal file
@ -0,0 +1,64 @@
|
||||
// This file is automatically generated, so please do not edit it.
|
||||
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.23.
|
||||
|
||||
// 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,
|
||||
}
|
Reference in New Issue
Block a user