flutter: file-transfer/port forward/rdp support

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-07-07 12:22:39 +08:00
parent 6c8c3b4a7a
commit 1f137b3542
9 changed files with 200 additions and 115 deletions

View File

@@ -52,10 +52,12 @@ class FileManagerPage extends StatefulWidget {
const FileManagerPage(
{Key? key,
required this.id,
required this.password,
required this.tabController,
this.forceRelay})
: super(key: key);
final String id;
final String? password;
final bool? forceRelay;
final DesktopTabController tabController;
@@ -79,7 +81,10 @@ class _FileManagerPageState extends State<FileManagerPage>
void initState() {
super.initState();
_ffi = FFI();
_ffi.start(widget.id, isFileTransfer: true, forceRelay: widget.forceRelay);
_ffi.start(widget.id,
isFileTransfer: true,
password: widget.password,
forceRelay: widget.forceRelay);
WidgetsBinding.instance.addPostFrameCallback((_) {
_ffi.dialogManager
.showLoading(translate('Connecting...'), onCancel: closeConnection);

View File

@@ -44,6 +44,7 @@ class _FileManagerTabPageState extends State<FileManagerTabPage> {
page: FileManagerPage(
key: ValueKey(params['id']),
id: params['id'],
password: params['password'],
tabController: tabController,
forceRelay: params['forceRelay'],
)));
@@ -72,6 +73,7 @@ class _FileManagerTabPageState extends State<FileManagerTabPage> {
page: FileManagerPage(
key: ValueKey(id),
id: id,
password: args['password'],
tabController: tabController,
forceRelay: args['forceRelay'],
)));

View File

@@ -28,11 +28,13 @@ class PortForwardPage extends StatefulWidget {
const PortForwardPage(
{Key? key,
required this.id,
required this.password,
required this.tabController,
required this.isRDP,
this.forceRelay})
: super(key: key);
final String id;
final String password;
final DesktopTabController tabController;
final bool isRDP;
final bool? forceRelay;
@@ -55,6 +57,7 @@ class _PortForwardPageState extends State<PortForwardPage>
_ffi = FFI();
_ffi.start(widget.id,
isPortForward: true,
password: widget.password,
forceRelay: widget.forceRelay,
isRdp: widget.isRDP);
Get.put(_ffi, tag: 'pf_${widget.id}');

View File

@@ -43,6 +43,7 @@ class _PortForwardTabPageState extends State<PortForwardTabPage> {
page: PortForwardPage(
key: ValueKey(params['id']),
id: params['id'],
password: params['password'],
tabController: tabController,
isRDP: isRDP,
forceRelay: params['forceRelay'],
@@ -77,6 +78,7 @@ class _PortForwardTabPageState extends State<PortForwardTabPage> {
page: PortForwardPage(
key: ValueKey(args['id']),
id: id,
password: args['password'],
isRDP: isRDP,
tabController: tabController,
forceRelay: args['forceRelay'],