From da9cedd293acdfc541a6f3b65ea154a06b7cd229 Mon Sep 17 00:00:00 2001 From: autorejecttop Date: Thu, 13 Nov 2025 14:03:03 +0700 Subject: [PATCH 1/4] Refactor user input radio buttons to use RadioGroup `groupValue` and `onChanged` parameter in `Radio` is deprecated after v3.32.0-0.0.pre --- .../get-started/fundamentals/user-input.md | 50 +++++++------------ 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/src/content/get-started/fundamentals/user-input.md b/src/content/get-started/fundamentals/user-input.md index a9c49d5e9e6..ded736a3c31 100644 --- a/src/content/get-started/fundamentals/user-input.md +++ b/src/content/get-started/fundamentals/user-input.md @@ -778,41 +778,29 @@ class _RadioExampleState extends State { @override Widget build(BuildContext context) { - return Column( - children: [ - ListTile( - title: const Text('Musician'), - leading: Radio( - value: Character.musician, - groupValue: _character, - onChanged: setCharacter, + return RadioGroup( + groupValue: _character, + onChanged: setCharacter, + child: Column( + children: [ + ListTile( + title: const Text('Musician'), + leading: Radio(value: Character.musician), ), - ), - ListTile( - title: const Text('Chef'), - leading: Radio( - value: Character.chef, - groupValue: _character, - onChanged: setCharacter, + ListTile( + title: const Text('Chef'), + leading: Radio(value: Character.chef), ), - ), - ListTile( - title: const Text('Firefighter'), - leading: Radio( - value: Character.firefighter, - groupValue: _character, - onChanged: setCharacter, + ListTile( + title: const Text('Firefighter'), + leading: Radio(value: Character.firefighter), ), - ), - ListTile( - title: const Text('Artist'), - leading: Radio( - value: Character.artist, - groupValue: _character, - onChanged: setCharacter, + ListTile( + title: const Text('Artist'), + leading: Radio(value: Character.artist), ), - ), - ], + ], + ), ); } } From dacad0f7d19872e2aa377b2004d8b6606471bab8 Mon Sep 17 00:00:00 2001 From: autorejecttop Date: Mon, 17 Nov 2025 06:31:01 +0700 Subject: [PATCH 2/4] Apply suggestions from code review - Fixing documentation text to include `RadioGroup` Co-authored-by: Parker Lougheed --- src/content/get-started/fundamentals/user-input.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/content/get-started/fundamentals/user-input.md b/src/content/get-started/fundamentals/user-input.md index ded736a3c31..e97395d23ff 100644 --- a/src/content/get-started/fundamentals/user-input.md +++ b/src/content/get-started/fundamentals/user-input.md @@ -746,8 +746,9 @@ the other radio buttons are unselected. - A particular `Radio` button's `value` represent that button's value, - The selected value for a group of radio buttons is identified by - the `groupValue` parameter. -- `Radio` also has an `onChanged` callback that +- The selected value for a `RadioGroup` is identified by +the `groupValue` parameter. +- `RadioGroup` has an `onChanged` callback that gets triggered when users click it, like `Switch` and `Checkbox` {% render "docs/code-and-image.md", From 692fb9e3c79877dadf29d4dbc33ee9cccaf467c8 Mon Sep 17 00:00:00 2001 From: autorejecttop Date: Mon, 17 Nov 2025 06:33:35 +0700 Subject: [PATCH 3/4] Apply suggestions from code review - Forgot to include this one in the previous commit - Fixed documentation text to include `RadioGroup` --- src/content/get-started/fundamentals/user-input.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/get-started/fundamentals/user-input.md b/src/content/get-started/fundamentals/user-input.md index e97395d23ff..90f84b56657 100644 --- a/src/content/get-started/fundamentals/user-input.md +++ b/src/content/get-started/fundamentals/user-input.md @@ -739,7 +739,7 @@ Widget build(BuildContext context) { ### Radio -A group of `Radio` buttons that allows the user to +A `RadioGroup` containing `Radio` buttons that allow the user to select between mutually exclusive values. When the user selects a radio button in a group, the other radio buttons are unselected. From 7d6539289012fb49b9b3895d723b0a34e7c93553 Mon Sep 17 00:00:00 2001 From: Parker Lougheed Date: Sun, 16 Nov 2025 20:16:00 -0600 Subject: [PATCH 4/4] Remove accidentally duplicated text --- src/content/get-started/fundamentals/user-input.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/content/get-started/fundamentals/user-input.md b/src/content/get-started/fundamentals/user-input.md index 90f84b56657..9981e263877 100644 --- a/src/content/get-started/fundamentals/user-input.md +++ b/src/content/get-started/fundamentals/user-input.md @@ -739,17 +739,16 @@ Widget build(BuildContext context) { ### Radio -A `RadioGroup` containing `Radio` buttons that allow the user to +A `RadioGroup` contains `Radio` buttons that allow the user to select between mutually exclusive values. When the user selects a radio button in a group, the other radio buttons are unselected. -- A particular `Radio` button's `value` represent that button's value, -- The selected value for a group of radio buttons is identified by +- A particular `Radio` button's `value` represent that button's value. - The selected value for a `RadioGroup` is identified by -the `groupValue` parameter. + the `groupValue` parameter. - `RadioGroup` has an `onChanged` callback that - gets triggered when users click it, like `Switch` and `Checkbox` + gets triggered when users click it, like `Switch` and `Checkbox`. {% render "docs/code-and-image.md", image:"fwe/user-input/Radio.webp",