t×tecexpressby TeKOcloud
DEv0.7.1
Editors & selection / FLUTTER

TxRadioGroup.

Interactive preview

Visible radio options for a single selection.

TxRadioGroup

ParameterTypeDefaultMeaning
itemsList<TxItem<T>>const []Entries; replaced by dataSource when bound.
dataSourceObject?nullList, configuration or DataSource instance; takes precedence over items.
valueT?nullCurrent input/option value.
onChangedValueChanged<T>?nullCallback for changed; see the signature for arguments and return type.
directionAxisAxis.verticalEntry layout direction.
disabledboolfalseDisables interaction.
labelString'Auswahl'Label or accessible name.
dart
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)),
  );
}