new: vnc (beta #227)

This commit is contained in:
lollipopkit
2023-12-03 14:16:07 +08:00
parent 7c2480f027
commit 5035fdce86
6 changed files with 144 additions and 0 deletions

View File

@@ -113,6 +113,10 @@ class BackupPage extends StatelessWidget {
TextButton(
onPressed: () async {
icloudLoading.value = true;
final files = await PersistentStore.getFileNames();
for (final file in files) {
await ICloud.download(relativePath: file);
}
icloudLoading.value = false;
},
child: Text(l10n.download),
@@ -121,6 +125,10 @@ class BackupPage extends StatelessWidget {
TextButton(
onPressed: () async {
icloudLoading.value = true;
final files = await PersistentStore.getFileNames();
for (final file in files) {
await ICloud.upload(relativePath: file);
}
icloudLoading.value = false;
},
child: Text(l10n.upload),

44
lib/view/page/vnc.dart Normal file
View File

@@ -0,0 +1,44 @@
import 'package:flutter/material.dart';
import 'package:flutter_rfb/flutter_rfb.dart';
import 'package:toolbox/data/res/ui.dart';
class VNCPage extends StatefulWidget {
const VNCPage({super.key});
@override
State<VNCPage> createState() => _VNCPageState();
}
class _VNCPageState extends State<VNCPage> {
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: InteractiveViewer(
constrained: true,
maxScale: 10,
child: RemoteFrameBufferWidget(
hostName: '47.108.212.173',
onError: (final Object error) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Error: $error'),
),
);
},
connectingWidget: UIs.centerLoading,
password: 'Pwd123',
),
),
);
}
}