What property groups RadioListTile buttons together?
groupValue determines which radio button is selected in the group.
Handle user selection from options
You can read this lesson publicly. Sign in to unlock exercises, quiz, and FX progress tracking.
Having trouble? AI is here to help
Ask context-aware questions about this lesson. Free plan: 5 questions/day. Upgrade to Premium for higher daily limits.
Use the AI button at the bottom of the screen
Flutter provides several widgets for letting users pick from a set of options. Checkboxes handle simple on/off choices, radio buttons let users pick one item from a small group, and dropdown menus work best when there are many options to choose from. Each widget follows the same pattern of holding the current value in state and updating it through an onChanged callback.
1// DropdownButton2String? selectedCountry;34DropdownButtonFormField<String>(5value: selectedCountry,6decoration: InputDecoration(7labelText: 'Country',8border: OutlineInputBorder(),9),10items: ['USA', 'UK', 'Canada', 'Australia']11.map((country) => DropdownMenuItem(12value: country,13child: Text(country),14))15.toList(),16onChanged: (value) {17setState(() {18selectedCountry = value;19});20},21validator: (value) => value == null ? 'Please select a country' : null,22)
1// Checkbox2bool agreeToTerms = false;34CheckboxListTile(5title: Text('I agree to the terms'),6value: agreeToTerms,7onChanged: (value) {8setState(() {9agreeToTerms = value ?? false;10});11},12)1314// Radio buttons15String? selectedGender;1617Column(18children: ['Male', 'Female', 'Other'].map((gender) {19return RadioListTile<String>(20title: Text(gender),21value: gender,22groupValue: selectedGender,23onChanged: (value) {24setState(() {25selectedGender = value;26});27},28);29}).toList(),30)
Use control type based on decision complexity:
Control choice directly affects speed, clarity, and error rate in user decisions.
Handle user selection from options. Widgets are reusable UI blocks. You combine them like LEGO pieces to build screens.
Connect each concept to real app features you can build.
Sketch the widget tree first, then code from top to bottom.
Most Flutter productivity comes from understanding layout rules and composing widgets cleanly.
groupValue determines which radio button is selected in the group.
DropdownButtonFormField integrates with Form widget for validation, unlike plain DropdownButton.
CheckboxListTile combines a Checkbox with a ListTile for a label, making it convenient for settings.
Setting onChanged to null disables the dropdown, making it non-interactive.
Something seems incorrect, unclear, or missing? Let us know.
FlutterCraft editorial lessons are reviewed by experienced Flutter developers and updated to stay aligned with modern Flutter and Dart best practices.
Reference docs: Flutter Documentation, Dart Language Tour, and official package documentation where relevant.
Sign in to continue with exercises and quiz for this lesson.
Sign In to Continue