WithEmptyValue<T> mixin

Protocol to build data which potentially could be empty

When data is empty data, it build the widget with buildEmpty, which render an empty view by default. When data is not empty, it builds the widget with buildContent, which needs to be implemented by developer.

WithEmptyValue implements BuildValue contract, so it works automatically with protocols depends on it, includes BuildAsyncSnapshot, BuildValueListenable, and BuildResultListenable.

Implemented types


hashCode int
The hash code for this object.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


buildContent(BuildContext context, T content) Widget
Contract to build view when data isn't empty
buildEmpty(BuildContext context, T emptyContent) Widget
Contract to build view when data is empty
buildValue(BuildContext context, T value) Widget
Behavior implementation of contract of BuildValue
checkIsValueEmpty(T value) bool
Check whether data is empty
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
toString() String
A string representation of this object.


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