diff --git a/lib/features/debug/presentation/debug/debug_screen.dart b/lib/features/debug/presentation/debug/debug_screen.dart index b7ae710e..6889dde1 100644 --- a/lib/features/debug/presentation/debug/debug_screen.dart +++ b/lib/features/debug/presentation/debug/debug_screen.dart @@ -56,7 +56,7 @@ class _ServerSwitchCard extends StatelessWidget { final ValueListenable urlState; final ValueChanged onUrlRadioButtonPressed; - final ValueChanged onChangeServerPressed; + final VoidCallback onChangeServerPressed; @override Widget build(BuildContext context) { @@ -70,20 +70,20 @@ class _ServerSwitchCard extends StatelessWidget { Text(l10n.debugScreenServerSubtitle), ValueListenableBuilder( valueListenable: urlState, - builder: (_, url, __) { + builder: (_, selectedUrl, __) { return Column( children: [ ...Url.values.map( - (u) => RadioListTile( + (url) => RadioListTile( value: url, - groupValue: url, + groupValue: selectedUrl, onChanged: onUrlRadioButtonPressed, title: Text(url.toString()), subtitle: Text(url.value), ), ), MaterialButton( - onPressed: () => onChangeServerPressed(url), + onPressed: onChangeServerPressed, child: Text( l10n.debugScreenServerConnectButton, style: const TextStyle(fontSize: AppSizes.double16), diff --git a/lib/features/debug/presentation/debug/debug_wm.dart b/lib/features/debug/presentation/debug/debug_wm.dart index c0bf182c..750bba50 100644 --- a/lib/features/debug/presentation/debug/debug_wm.dart +++ b/lib/features/debug/presentation/debug/debug_wm.dart @@ -46,7 +46,7 @@ abstract interface class IDebugScreenWM with ILocalizationMixin implements IWidg void onUrlRadioButtonPressed(Url? url); /// Callback of pressed on the server change button. - void onChangeServerPressed(Url url); + void onChangeServerPressed(); /// Callback of pressed on the connect proxy button. void onConnectProxyPressed(); @@ -107,8 +107,8 @@ class DebugScreenWM extends WidgetModel with Localizati } @override - Future onChangeServerPressed(Url url) async { - await model.saveServerUrl(url); + Future onChangeServerPressed() async { + await model.saveServerUrl(_serverUrlState.value); _showReloadAppSnackBar(); }