mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
opt.
This commit is contained in:
@@ -37,8 +37,8 @@ class DiskIO extends TimeSeq<DiskIOPiece> {
|
||||
final sectorsRead = now.sectorsRead - pre.sectorsRead;
|
||||
final sectorsWrite = now.sectorsWrite - pre.sectorsWrite;
|
||||
final time = now.time - pre.time;
|
||||
final read = (sectorsRead / time * 512);
|
||||
final write = (sectorsWrite / time * 512);
|
||||
final read = sectorsRead / time * 512;
|
||||
final write = sectorsWrite / time * 512;
|
||||
return (read, write);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,19 +77,19 @@ class SftpReqStatus {
|
||||
void onNotify(dynamic event) {
|
||||
var shouldDispose = false;
|
||||
switch (event) {
|
||||
case SftpWorkerStatus val:
|
||||
case final SftpWorkerStatus val:
|
||||
status = val;
|
||||
if (status == SftpWorkerStatus.finished) {
|
||||
dispose();
|
||||
}
|
||||
break;
|
||||
case double val:
|
||||
case final double val:
|
||||
progress = val;
|
||||
break;
|
||||
case int val:
|
||||
case final int val:
|
||||
size = val;
|
||||
break;
|
||||
case Duration d:
|
||||
case final Duration d:
|
||||
spentTime = d;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -56,7 +56,7 @@ Future<void> isolateMessageHandler(
|
||||
SendErrorFunction sendError,
|
||||
) async {
|
||||
switch (data) {
|
||||
case SftpReq val:
|
||||
case final SftpReq val:
|
||||
switch (val.type) {
|
||||
case SftpReqType.download:
|
||||
await _download(data, mainSendPort, sendError);
|
||||
|
||||
Reference in New Issue
Block a user