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

TxLookup.

Interactive preview

Searchable single selection backed by a loadable data source.

TxLookup

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.
disabledboolfalseDisables interaction.
labelString'Auswählen'Label or accessible name.
searchEnabledbooltrueEnables searching.
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) => TxLookup<int>(items: options, value: choice, onChanged: (v) => setState(() => choice = v)),
  );
}