mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2026-01-31 13:25:10 +01:00
Merge branch 'main' of https://github.com/lollipopkit/flutter_server_box
This commit is contained in:
@@ -21,7 +21,6 @@ import 'package:toolbox/view/page/storage/local.dart';
|
||||
import '../data/model/server/snippet.dart';
|
||||
import '../view/page/debug.dart';
|
||||
import '../view/page/editor.dart';
|
||||
import '../view/page/full_screen.dart';
|
||||
import '../view/page/process.dart';
|
||||
import '../view/page/server/edit.dart';
|
||||
import '../view/page/server/tab.dart';
|
||||
@@ -175,9 +174,9 @@ class AppRoute {
|
||||
'editor');
|
||||
}
|
||||
|
||||
static AppRoute fullscreen({Key? key}) {
|
||||
return AppRoute(FullScreenPage(key: key), 'fullscreen');
|
||||
}
|
||||
// static AppRoute fullscreen({Key? key}) {
|
||||
// return AppRoute(FullScreenPage(key: key), 'fullscreen');
|
||||
// }
|
||||
|
||||
static AppRoute home({Key? key}) {
|
||||
return AppRoute(HomePage(key: key), 'home');
|
||||
|
||||
@@ -28,20 +28,26 @@ abstract final class ICloud {
|
||||
String? localPath,
|
||||
}) async {
|
||||
final completer = Completer<ICloudErr?>();
|
||||
await ICloudStorage.upload(
|
||||
containerId: _containerId,
|
||||
filePath: localPath ?? '${await Paths.doc}/$relativePath',
|
||||
destinationRelativePath: relativePath,
|
||||
onProgress: (stream) {
|
||||
stream.listen(
|
||||
null,
|
||||
onDone: () => completer.complete(null),
|
||||
onError: (e) => completer.complete(
|
||||
ICloudErr(type: ICloudErrType.generic, message: '$e'),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
try {
|
||||
await ICloudStorage.upload(
|
||||
containerId: _containerId,
|
||||
filePath: localPath ?? '${await Paths.doc}/$relativePath',
|
||||
destinationRelativePath: relativePath,
|
||||
onProgress: (stream) {
|
||||
stream.listen(
|
||||
null,
|
||||
onDone: () => completer.complete(null),
|
||||
onError: (e) => completer.complete(
|
||||
ICloudErr(type: ICloudErrType.generic, message: '$e'),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
} catch (e, s) {
|
||||
_logger.warning('Upload $relativePath failed', e, s);
|
||||
completer.complete(ICloudErr(type: ICloudErrType.generic, message: '$e'));
|
||||
}
|
||||
|
||||
return completer.future;
|
||||
}
|
||||
|
||||
@@ -52,10 +58,14 @@ abstract final class ICloud {
|
||||
}
|
||||
|
||||
static Future<void> delete(String relativePath) async {
|
||||
await ICloudStorage.delete(
|
||||
containerId: _containerId,
|
||||
relativePath: relativePath,
|
||||
);
|
||||
try {
|
||||
await ICloudStorage.delete(
|
||||
containerId: _containerId,
|
||||
relativePath: relativePath,
|
||||
);
|
||||
} catch (e, s) {
|
||||
_logger.warning('Delete $relativePath failed', e, s);
|
||||
}
|
||||
}
|
||||
|
||||
/// Download file from iCloud
|
||||
|
||||
Reference in New Issue
Block a user