remove overlay of PortForward page because it will cause rebuilding when closing

msgbox

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2022-09-05 16:28:49 +08:00
parent 48481884b1
commit 31550452c3

View File

@ -70,45 +70,38 @@ class _PortForwardPageState extends State<PortForwardPage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
return Overlay(initialEntries: [ return Scaffold(
OverlayEntry(builder: (context) { backgroundColor: MyTheme.color(context).grayBg,
_ffi.dialogManager.setOverlayState(Overlay.of(context)); body: FutureBuilder(future: () async {
return Scaffold( if (!isRdp) {
backgroundColor: MyTheme.color(context).grayBg, refreshTunnelConfig();
body: FutureBuilder(future: () async { }
if (!isRdp) { }(), builder: (context, snapshot) {
refreshTunnelConfig(); if (snapshot.connectionState == ConnectionState.done) {
} return Container(
}(), builder: (context, snapshot) { decoration: BoxDecoration(
if (snapshot.connectionState == ConnectionState.done) { border: Border.all(
return Container( width: 20, color: MyTheme.color(context).grayBg!)),
decoration: BoxDecoration( child: Column(
border: Border.all( crossAxisAlignment: CrossAxisAlignment.stretch,
width: 20, color: MyTheme.color(context).grayBg!)), children: [
child: Column( buildPrompt(context),
crossAxisAlignment: CrossAxisAlignment.stretch, Flexible(
children: [ child: Container(
buildPrompt(context), decoration: BoxDecoration(
Flexible( color: MyTheme.color(context).bg,
child: Container( border: Border.all(width: 1, color: MyTheme.border)),
decoration: BoxDecoration( child:
color: MyTheme.color(context).bg, widget.isRDP ? buildRdp(context) : buildTunnel(context),
border: ),
Border.all(width: 1, color: MyTheme.border)),
child: widget.isRDP
? buildRdp(context)
: buildTunnel(context),
),
),
],
), ),
); ],
} ),
return const Offstage(); );
}), }
); return const Offstage();
}) }),
]); );
} }
buildPrompt(BuildContext context) { buildPrompt(BuildContext context) {