'Getting text value from active radio button in Flutter

Hi my goal is to have a list of RadioButtons where each of them will have their unique name. At the top there is a Text() field which will take that name from radio button and update it accordingly to Radio buttons name.

Here is an example:

enter image description here

And when you press Option 2 radio button the Text field changes according to it:

enter image description here

How can I achieve this because Im fairly new to Flutter and Dart. Thanks in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source