TListDetail<T, K> class

A master-detail split layout widget that displays a list of items on the left and details of the selected item on the right.

TListDetail is responsive: on wider screens it splits the screen into a sidebar list and a details pane, while on narrower (mobile) screens it behaves like a navigation stack.

Inheritance
Mixed-in types
Available extensions

Constructors

TListDetail({Key? key, required Widget detailBuilder(BuildContext context, TListItem<T, K> item, int index), Widget createBuilder(BuildContext context)?, Widget editBuilder(BuildContext context, TListItem<T, K> item, int index)?, WidgetBuilder? sidebarHeaderBuilder, WidgetBuilder? sidebarFooterBuilder, String? itemTitle(T item)?, String? itemSubTitle(T item)?, String? itemImageUrl(T item)?, dynamic itemIcon(T item)?, Widget itemLeading(T item)?, ListItemBuilder<T, K>? itemBuilder, List<Widget> actions(T item)?, double sideListWidth = 275.0, double minSideExpandWidth = 700.0, bool showSearch = true, String searchPlaceholder = 'Search...', double gap = 0.0, EdgeInsetsGeometry? padding, BorderRadius? borderRadius, List<BoxShadow>? shadow, Color? borderColor, BorderRadius? sidebarBorderRadius, List<BoxShadow>? sidebarShadow, Color? sidebarBorderColor, BorderRadius? detailBorderRadius, List<BoxShadow>? detailShadow, Color? detailBorderColor, Color? cardBackgroundColor, Color? backgroundColor, WidgetBuilder? emptyBuilder, dynamic emptyIcon, String? emptyTitle, String? emptyDescription, List<T>? items, int? itemsPerPage, String? search, int? searchDelay, TLoadListener<T>? onLoad, ItemKeyAccessor<T, K>? itemKey, TListController<T, K>? controller, TControllerReadyListener<T, K>? onControllerReady})
const

Properties

actions → List<Widget> Function(T item)?
Optional actions to display in the header/AppBar of the detail pane.
final
backgroundColor → Color?
Optional background color for the container behind the cards. Defaults to ColorScheme.surface when null.
final
borderColor → Color?
Default border color for both cards in split layout. Defaults to colors.outlineVariant.o(0.5).
final
borderRadius → BorderRadius?
Default border radius for both cards in split layout. Defaults to BorderRadius.circular(16).
final
cardBackgroundColor → Color?
Optional background color for the floating cards. Defaults to ColorScheme.surface when null.
final
controller → TListController<T, K>?
The controller managing the list state.
final
createBuilder → Widget Function(BuildContext context)?
Optional builder to display when creating a new item.
final
detailBorderColor → Color?
Custom border color override for the detail pane in split layout.
final
detailBorderRadius → BorderRadius?
Custom border radius override for the detail pane in split layout.
final
detailBuilder → Widget Function(BuildContext context, TListItem<T, K> item, int index)
Builder for rendering the detail content of the selected item.
final
detailShadow → List<BoxShadow>?
Custom shadow override for the detail pane in split layout.
final
editBuilder → Widget Function(BuildContext context, TListItem<T, K> item, int index)?
Optional builder to display when editing an item.
final
emptyBuilder → Widget Function(BuildContext context)?
Optional custom builder for the empty state when no item is selected.
final
emptyDescription → String?
Optional description text in the default empty state. Defaults to 'Select an item from the list to view its details'.
final
emptyIcon → dynamic
Optional icon to display in the default empty state. Supports IconData, List<List<dynamic>> (HugeIcon), or Widget.
final
emptyTitle → String?
Optional title text in the default empty state. Defaults to 'No item selected'.
final
gap → double
The horizontal gap/spacing between the sidebar card and detail card in split layout. Defaults to 12.0.
final
hashCode → int
The hash code for this object.
no setterinherited
itemBuilder → Widget Function(BuildContext context, TListItem<T, K> item, int index)?
Optional custom builder for items in the list. If null, a default TListCard is rendered.
final
itemIcon → dynamic Function(T item)?
Optional callback to extract the icon from an item.
final
itemImageUrl → String? Function(T item)?
Callback to extract the image URL from an item.
final
itemKey → ItemKeyAccessor<T, K>?
Function to extract a unique key from an item.
final
itemLeading → Widget Function(T item)?
Optional callback to extract the leading widget from an item.
final
items → List<T>?
The list of items to display.
final
itemsPerPage → int?
The number of items to display per page.
final
itemSubTitle → String? Function(T item)?
Callback to extract the subtitle from an item.
final
itemTitle → String? Function(T item)?
Callback to extract the title from an item.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
minSideExpandWidth → double
The minimum width required to show the split master-detail layout. If constraints are below this value, it collapses to a single pane. Defaults to 700.0.
final
onControllerReady → TControllerReadyListener<T, K>?
Callback fired when the list controller is initialized and ready for setup or binding.
final
onLoad → TLoadListener<T>?
Callback for loading items from a server.
final
padding → EdgeInsetsGeometry?
Optional padding around the split layout.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
The current search query.
final
searchDelay → int?
Debounce delay for search in milliseconds.
final
searchPlaceholder → String
Placeholder text for the search field. Defaults to 'Search...'.
final
shadow → List<BoxShadow>?
Default shadow for both cards in split layout. Defaults to a modern subtle elevation shadow.
final
showSearch → bool
Whether to show the search text field in the sidebar. Defaults to true.
final
sidebarBorderColor → Color?
Custom border color override for the items sidebar panel in split layout.
final
sidebarBorderRadius → BorderRadius?
Custom border radius override for the items sidebar panel in split layout.
final
sidebarFooterBuilder → Widget Function(BuildContext context)?
Optional builder for a footer widget below the sidebar list.
final
sidebarHeaderBuilder → Widget Function(BuildContext context)?
Optional builder for a header widget above the sidebar search bar.
final
sidebarShadow → List<BoxShadow>?
Custom shadow override for the items sidebar panel in split layout.
final
sideListWidth → double
The width of the left side list/sidebar on wide screens. Defaults to 275.0.
final

Methods

box({double minW = 0.0, double minH = 0.0, double maxW = double.infinity, double maxH = double.infinity}) → Widget

Available on Widget, provided by the WidgetX extension

Wraps this widget in a ConstrainedBox to apply layout constraints.
center({bool when = true}) → Widget

Available on Widget, provided by the WidgetX extension

Wraps this widget in a Center widget.
createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<TListDetail<T, K>>
Creates the mutable state for this widget at a given location in the tree.
override
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
expanded({int flex = 1}) → Widget

Available on Widget, provided by the WidgetX extension

Wraps this widget in an Expanded widget.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
padding([double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0]) → Widget

Available on Widget, provided by the WidgetX extension

Wraps this widget in a Padding with flexible edge control.
paddingSymmetric({double h = 0.0, double v = 0.0}) → Widget

Available on Widget, provided by the WidgetX extension

Wraps this widget in a Padding with symmetric horizontal and vertical spacing.
size({double? w, double? h}) → Widget

Available on Widget, provided by the WidgetX extension

Wraps this widget in a SizedBox to apply fixed width and/or height.
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
visible(bool visible, {bool maintainState = false}) → Widget

Available on Widget, provided by the WidgetX extension

Wraps this widget in a Visibility widget.
when(bool condition) → Widget

Available on Widget, provided by the WidgetX extension

Returns this widget if condition is true, otherwise returns SizedBox.shrink(). Usage: Text('Hello').when(isVisible)

Operators

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