onEmpty property
A widget to be displayed in the case that the internal document list is empty (or a collection is empty).
Note: Leaving this as null will create a fallback pattern of:
- If
onEmptyis null, fallback toonDataif it's not null. - Otherwise, fallback to the
fallbackWidgetif it's not null. - Or as last resort, fallback to a
SizedBox.shrink()(essentialy blank space). Therefore, it's encouraged to handle this state althoguh it is optional.
Implementation
final Widget? onEmpty;