t×tecexpressby TeKOcloud
DEv0.7.1
Data & views / FLUTTER

TxCardView.

Interactive preview

Card collection with search, paging, selection and custom content.

TxCardView

ParameterTypeDefaultMeaning
dataSourceObjectrequiredList, configuration or DataSource instance; takes precedence over items.
keyOfObject Function(T row)requiredReads the stable record key.
titleOfString Function(T row)requiredCard title getter.
subtitleOfString? Function(T row)?nullCard subtitle getter.
imageOfString? Function(T row)?nullCard image URL getter.
imageAltOfString? Function(T row)?nullImage alternative text getter.
columnsList<TxCardField<T>>const []Column or card field configurations.
searchEnabledbooltrueEnables searching.
searchTextOfString? Function(T row)?nullSearchable card text getter.
pageSizeint6Records per page.
pageIndexint?nullZero-based page index.
onPageIndexChangedValueChanged<int>?nullReports pageIndex; update controlled state in the callback.
selectionTxSelectionModeTxSelectionMode.noneSelection mode.
selectedCardKeysSet<Object>?nullControlled set of selected card keys.
onSelectedCardKeysChangedValueChanged<Set<Object>>?nullReports selectedCardKeys; update controlled state in the callback.
onSelectionChangedValueChanged<TxSelection<T>>?nullReports selection; update controlled state in the callback.
onCardClickValueChanged<T>?nullReports the record activated through the details action.
onSearchChangedValueChanged<String>?nullReports search; update controlled state in the callback.
loadingboolfalseShows the loading state.
disabledboolfalseDisables interaction.
noDataTextString'Keine Karten vorhanden.'Text for an empty collection.
labelString'Kartenansicht'Label or accessible name.
itemBuilderWidget Function(BuildContext context, T row, bool selected)?nullBuilds custom content; callback arguments and return type are given in the signature.
mediaBuilderWidget Function(BuildContext context, T row)?nullBuilds custom content; callback arguments and return type are given in the signature.
contentBuilderWidget Function(BuildContext context, T row)?nullBuilds custom content; callback arguments and return type are given in the signature.
footerBuilderWidget Function(BuildContext context, T row)?nullBuilds custom content; callback arguments and return type are given in the signature.
dart
import 'package:flutter/material.dart';
import 'package:tecexpress/tecexpress.dart';

Widget example() {
  final rows = <Map<String, Object>>[{'id': 1, 'name': 'Alex'}];
  return TxCardView<Map<String, Object>>(dataSource: rows, keyOf: (row) => row['id']!, titleOf: (row) => '${row['name']}');
}