ZdsListTileWrapper class
This Widget takes in the following parameters:
key : Key to assign to the widget.
child : The Widget that will be wrapped by ZdsListTileWrapper. Typically a ZdsListTile for the styling to be applied to.
top : A boolean value to indicate whether to add custom styling to the top part of the widget. Default value is false
.
bottom : A boolean value to indicate whether to add custom styling to the bottom part of the widget. Default value is false
.
dividers : A boolean value to indicate whether to add divider below the child. Default value is true
.
Here is an example of how to use this class:
static const tileCount = 6;
@override
Widget build(BuildContext context) {
return Scaffold(
body: ListView.separated(
itemCount: tileCount,
padding: const EdgeInsets.all(14),
separatorBuilder: (context, index) => const Divider(),
itemBuilder: (context, index) {
return ZdsListTileWrapper(
top: index == 0,
bottom: index == (tileCount - 1),
child: ZdsListTile(
title: Text('Title $index'),
subtitle: Text('Subtitle $index'),
),
);
},
),
);
}
Note: You should specify key value if you need to reference this particular widget later on, you can leave it otherwise.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- ZdsListTileWrapper
- Available Extensions
Constructors
- ZdsListTileWrapper({Key? key, required Widget child, bool top = false, bool bottom = false, bool dividers = true, Color? backgroundColor})
-
Constructs a ZdsListTileWrapper.
const
Properties
- backgroundColor → Color?
-
Background Color of the wrapper
final
- bottom → bool
-
Whether the tile is the last (at the bottom) of the list.
final
- child → Widget
-
The Widget that will be wrapped by
ZdsListTileWrapper
.final - dividers → bool
-
Whether the divider should be added at the bottom of the tile.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- top → bool
-
Whether the tile is the first (at the top) of the list.
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.
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}) → 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