HRadioListView<T> class

A grouped, rounded-corner, single-select radio list.

Mirrors HListView's two construction styles:

Example:

HRadioListView<String>(
  groupValue: selected,
  onChanged: (value) => setState(() => selected = value),
  items: const [
    HRadioListItemData(title: 'Small', subtitle: '', value: 's'),
    HRadioListItemData(title: 'Large', subtitle: '', value: 'l'),
  ],
)
Inheritance

Constructors

HRadioListView({Key? key, required List<HRadioListItemData<T>> items, required T groupValue, required ValueChanged<T> onChanged, bool? enableScroll, bool? shrinkWrap, bool? dense})
Creates a grouped radio list from an eagerly-built items list.
const
HRadioListView.builder({Key? key, required int itemCount, required HRadioListItemData<T> itemBuilder(int index), required T groupValue, required ValueChanged<T> onChanged, bool? enableScroll, bool? shrinkWrap, bool? dense})
Creates a grouped radio list that builds its itemCount rows lazily via itemBuilder, analogous to ListView.builder.
const

Properties

dense → bool?
Whether rows use the compact/"dense" ListTile layout.
final
enableScroll → bool?
Whether the list can be scrolled independently of its parent.
final
groupValue → T
The currently-selected value. The row whose HRadioListItemData.value equals this is rendered as selected.
final
hashCode → int
The hash code for this object.
no setterinherited
itemBuilder → HRadioListItemData<T> Function(int index)?
Builds the row at the given index, when constructed via HRadioListView.builder.
final
itemCount → int?
The number of rows to render, when constructed via HRadioListView.builder.
final
items → List<HRadioListItemData<T>>?
The rows to render, when constructed via HRadioListView.new.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onChanged → ValueChanged<T>
Called with the newly-selected value when the user picks a row.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shrinkWrap → bool?
Whether the list should size itself to its content.
final

Methods

build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
override
createElement() → StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

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