mirror of https://github.com/ospab/ostp.git
fix(flutter): show Junk/TCP-Frag controls only when transport is UoT
Junk packets and TCP fragmentation only take effect on the UoT (TCP) transport — the UDP path applies neither — so showing them (with an implicit "UoT only" caveat) while UDP is selected was misleading. The whole DPI OBFUSCATION section is now gated on transportMode == 'uot' and appears/disappears reactively when the Transport dropdown changes (setDialogState already rebuilds the dialog).
This commit is contained in:
parent
5fcc0ba7f4
commit
108ab8468b
|
|
@ -265,39 +265,42 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||||
if (v != null) setDialogState(() => transportMode = v);
|
if (v != null) setDialogState(() => transportMode = v);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
const Divider(height: 32),
|
// Junk packets and TCP fragmentation only take effect on the
|
||||||
// Junk packets + TCP fragmentation moved into their own
|
// UoT (TCP) transport — the UDP path applies neither — so the
|
||||||
// modals (tap to configure) — this dialog was carrying too
|
// whole section is hidden under UDP instead of shown with a
|
||||||
// many fields at once; these two are advanced/occasional
|
// "UoT only" caveat. Reactive: switching Transport above calls
|
||||||
// settings, not something every profile edit needs to see.
|
// setDialogState, which rebuilds this and shows/hides it.
|
||||||
const Text('DPI OBFUSCATION', style: TextStyle(fontWeight: FontWeight.bold, fontSize: 13, color: Colors.white54, letterSpacing: 1.0)),
|
if (transportMode == 'uot') ...[
|
||||||
const SizedBox(height: 12),
|
const Divider(height: 32),
|
||||||
Row(
|
const Text('DPI OBFUSCATION', style: TextStyle(fontWeight: FontWeight.bold, fontSize: 13, color: Colors.white54, letterSpacing: 1.0)),
|
||||||
children: [
|
const SizedBox(height: 12),
|
||||||
Expanded(
|
Row(
|
||||||
child: OutlinedButton.icon(
|
children: [
|
||||||
icon: const Icon(Icons.shuffle_rounded, size: 18),
|
Expanded(
|
||||||
label: const Text('Junk Packets'),
|
child: OutlinedButton.icon(
|
||||||
onPressed: () => _showJunkPacketsModal(
|
icon: const Icon(Icons.shuffle_rounded, size: 18),
|
||||||
context, junkPcMinCtrl, junkPcMaxCtrl, junkPsMinCtrl, junkPsMaxCtrl,
|
label: const Text('Junk Packets'),
|
||||||
|
onPressed: () => _showJunkPacketsModal(
|
||||||
|
context, junkPcMinCtrl, junkPcMaxCtrl, junkPsMinCtrl, junkPsMaxCtrl,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(width: 12),
|
||||||
const SizedBox(width: 12),
|
Expanded(
|
||||||
Expanded(
|
child: OutlinedButton.icon(
|
||||||
child: OutlinedButton.icon(
|
icon: Icon(tcpFragmentation ? Icons.call_split_rounded : Icons.horizontal_rule_rounded, size: 18),
|
||||||
icon: Icon(tcpFragmentation ? Icons.call_split_rounded : Icons.horizontal_rule_rounded, size: 18),
|
label: Text(tcpFragmentation ? 'TCP Frag: On' : 'TCP Frag: Off'),
|
||||||
label: Text(tcpFragmentation ? 'TCP Frag: On' : 'TCP Frag: Off'),
|
onPressed: () => _showTcpFragModal(
|
||||||
onPressed: () => _showTcpFragModal(
|
context,
|
||||||
context,
|
tcpFragmentation,
|
||||||
tcpFragmentation,
|
(v) => setDialogState(() => tcpFragmentation = v),
|
||||||
(v) => setDialogState(() => tcpFragmentation = v),
|
fragChunkCtrl, fragSleepCtrl,
|
||||||
fragChunkCtrl, fragSleepCtrl,
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue