DialogChoice<T> class

Class to represent a choice in the dialogues that list a choice list.

The choices are used in the following dialogs:

Below is an example of use in no showChoicesRadioDialog.

String result = await showChoicesRadioDialog<String>(context,
    title: Text('Select user'),
    choices: [
        DialogChoice(
            icon: Icon(Icons.person),
            title: Text('Ricardo Crescenti'),
            subtitle: Text('ricardo.crescenti@gmail.com'),
            value: 'ricardo.crescenti'),
        DialogChoice(
            icon: Icon(Icons.person),
            title: Text('Ana Luiza Crescenti'),
            subtitle: Text('analuiza.crescenti@gmail.com'),
            value: 'analuiza.crescenti'),
        DialogChoice(
            icon: Icon(Icons.person),
            title: Text('Luis Otavio Crescenti'),
            subtitle: Text('luisotavio.crescenti@gmail.com'),
            value: 'luisotavio.crescenti'),
    ]
);

Constructors

DialogChoice({Widget? icon, required Widget title, Widget? subtitle, required T value, bool checked = false})
Standard constructor of the DialogChoice class

Properties

checked bool
Identifies if the choice is already checked by default, this parameter is only used for radio and checkbox dialogs
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
icon Widget?
Icon to be listed in the choice list.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subtitle Widget?
Subtitle of choice (or additional information).
final
title Widget
Title of choice.
final
value → T
Value to be returned when the choice is selected.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited