DesignListDetail<T extends Object> class
A list (listBuilder) and the detail of selectedItem (detailBuilder), as Compose's ListDetailPaneScaffold.
Side by side (sideBySide, or from DesignWindowSizeClass.expanded's 840 up in its own width), the list listWidth wide at the start, the detail beside it (with nothing chosen, emptyDetailBuilder); given a dividerBuilder, a DesignSplitView the reader can resize. Narrow, the list alone: choosing an item pushes detailRouteBuilder's route (the look's page route) with its detail, and that route's pop clears the choice. Narrow to wide, the pushed detail leaves and shows beside the list; wide to narrow with an item chosen, it is pushed.
DesignListDetail<String>(selectedItem: null, onSelectedItemChanged: (item) {}, listBuilder: (context) => const Text('Inbox'), detailBuilder: (context, item) => Text(item), detailRouteBuilder: (builder) => PageRouteBuilder<void>(pageBuilder: (context, _, _) => builder(context)))
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- DesignListDetail
Constructors
-
DesignListDetail({Key? key, required T? selectedItem, required ValueChanged<
T?> onSelectedItemChanged, required WidgetBuilder listBuilder, required Widget detailBuilder(BuildContext context, T item), required Route<void> detailRouteBuilder(WidgetBuilder builder), WidgetBuilder? emptyDetailBuilder, bool? sideBySide, DesignDividerBuilder? dividerBuilder, double listWidth = 360}) -
A list and its chosen item's detail.
const
Properties
- detailBuilder → Widget Function(BuildContext context, T item)
-
An item's detail.
final
-
detailRouteBuilder
→ Route<
void> Function(WidgetBuilder builder) -
The route a narrow list-detail pushes the detail in, around the builder
it is given: the look's page route.
final
- dividerBuilder → DesignDividerBuilder?
-
Side by side, the divider of a DesignSplitView the reader resizes;
null: the list fixed at listWidth.
final
- emptyDetailBuilder → WidgetBuilder?
-
Side by side with nothing chosen; null: empty.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- listBuilder → WidgetBuilder
-
The list pane.
final
- listWidth → double
-
The list pane's width side by side (its first width, resizable).
final
-
onSelectedItemChanged
→ ValueChanged<
T?> -
Called with an item chosen (the list's rows call it), or with null as
a pushed detail pops.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedItem → T?
-
The item whose detail shows; null: none.
final
- sideBySide → bool?
-
Whether list and detail show side by side; null: from 840 wide up.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< DesignListDetail< T> > -
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.
override
-
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