t×tecexpressby TeKOcloud
DEv0.7.1
API & types / FLUTTER

TxSourceState.

Lifecycle mixin for data-bound StatefulWidgets. Implement sourceInput; only owned sources are disposed.

Member / type / returnMeaning
Object? get sourceInputList/configuration/instance binding implemented by a custom State.
List<T> get sourceFallbackFallback list without a bound source.
TxDataSource<T>? boundSourceCurrently bound source; borrowed instances remain owned by the caller.
void sourceChanged()Hook after a bound source changes; override in custom states.
List<T> get sourceItemsCurrently visible bound records.
void dispose()Stops queries and listeners; do not use the instance afterward.
dart
import 'package:flutter/material.dart';
import 'package:tecexpress/tecexpress.dart';

class BoundLabel extends StatefulWidget {
  const BoundLabel({super.key, required this.source});
  final Object source;
  @override
  State<BoundLabel> createState() => _BoundLabelState();
}

class _BoundLabelState extends State<BoundLabel>
    with TxSourceState<BoundLabel, String> {
  @override
  Object get sourceInput => widget.source;
  @override
  Widget build(BuildContext context) => Text(sourceItems.join(', '));
}