Visible radio options for a single selection.
TxRadioGroup
| Parameter | Type | Default | Meaning |
|---|---|---|---|
| items | List<TxItem<T>> | const [] | Entries; replaced by dataSource when bound. |
| dataSource | Object? | null | List, configuration or DataSource instance; takes precedence over items. |
| value | T? | null | Current input/option value. |
| onChanged | ValueChanged<T>? | null | Callback for changed; see the signature for arguments and return type. |
| direction | Axis | Axis.vertical | Entry layout direction. |
| disabled | bool | false | Disables interaction. |
| label | String | 'Auswahl' | Label or accessible 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)),
);
}