Sichtbare Optionsfelder für eine Einzelwahl.
TxRadioGroup
| Parameter | Typ | Standard | Bedeutung |
|---|---|---|---|
| items | List<TxItem<T>> | const [] | Einträge; bei Datenbindung durch dataSource ersetzt. |
| dataSource | Object? | null | Liste, Konfiguration oder DataSource-Instanz; hat Vorrang vor items. |
| value | T? | null | Aktueller Eingabe-/Optionswert. |
| onChanged | ValueChanged<T>? | null | Callback für changed; Argumente und Rückgabetyp siehe Signatur. |
| direction | Axis | Axis.vertical | Anordnung der Einträge. |
| disabled | bool | false | Sperrt die Interaktion. |
| label | String | 'Auswahl' | Beschriftung beziehungsweise zugänglicher Name. |
import 'package:flutter/material.dart';
import 'package:tecexpress/tecexpress.dart';
Widget example() {
const options = [TxItem(value: 1, text: 'One'), TxItem(value: 2, text: 'Two')];
int? choice = 1;
return StatefulBuilder(
builder: (context, setState) => TxRadioGroup<int>(items: options, value: choice, onChanged: (v) => setState(() => choice = v)),
);
}