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

Properties

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

Methods

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
override
checkIsValueEmpty(T value) bool
Check whether data is empty
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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