Commit eb927f4
review: gate peer-proxy toggle to FFI-supported platforms
Three review comments converged on the same root cause: the toggle was
gated to PlatformUtils.isDesktop and the platform-service shims invoked
MethodChannel methods that have no native handlers anywhere
(Android/iOS/macOS), so on any non-FFI platform the toggle would
render but the call would fail with MissingPluginException.
* vpn_setting.dart: gate to PlatformUtils.isFFISupported (Windows +
Linux), where the FFI path actually drives the toggle.
* radiance_settings_providers.dart: skip the isPeerProxyEnabled probe
in _refresh on non-FFI platforms so we don't log a failure on every
settings init.
* lantern_platform_service.dart: replace the MethodChannel passthroughs
with explicit "not supported on this platform" stubs. They exist
only for LanternCoreService interface conformance; the UI gate
prevents them from ever being called.
macOS / iOS / Android support requires a native handler (Swift /
Kotlin) calling into the Go core; that's a follow-up.
flutter analyze: clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d001209 commit eb927f4
3 files changed
Lines changed: 19 additions & 21 deletions
File tree
- lib
- features
- home/provider
- setting
- lantern
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
39 | | - | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
44 | | - | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
55 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
56 | 61 | | |
57 | 62 | | |
58 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
291 | 295 | | |
292 | 296 | | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
302 | 301 | | |
303 | 302 | | |
304 | 303 | | |
305 | 304 | | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
| 305 | + | |
313 | 306 | | |
314 | 307 | | |
315 | 308 | | |
| |||
0 commit comments