EmptyableContentBuilder<T> class

A builder handles blank content. It invokes emptyBuilder when value given is blank. Oherwise, builder will be used.

If is useful when content is nullable Or using ListView or similar with List that could be empty.

Inheritance

Constructors

EmptyableContentBuilder({Key? key, required T? content, EmptyChecker<T>? emptyChecker, WidgetBuilder? emptyBuilder, required ValueResultBuilder<T> builder})
Create the widget

Properties

builder ValueResultBuilder<T>
Builder to be used when content isn't blank
final
content → T?
The given value
final
emptyBuilder WidgetBuilder?
Builder to be used when content is blank
final
emptyChecker EmptyChecker<T>
Function used to determine whether content is blank or not
final
hashCode int
The hash code for this object.
no setterinherited
isValueBlank bool
is content considered as blank or not
no setter
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

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.
inherited
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

Static Methods

defaultEmptyChecker(dynamic content) bool
Default empty checker. It supports Emptyable List, Map, Iterable, String, by calling isEmpty on it. Otherwise, UnsupportedError is thrown.