Related question:
How to present an empty view in flutter?
Like that question, I need to return an empty view from Widget.build
to indicate that there is nothing to render, but of course cannot return null. The widget will be used in the slivers
of a CustomScrollView
.
However, the suggestions from the answers to that question give errors when trying to use them in a Sliver (for example SizedBox.shrink()
).
It seems that an empty const SliverToBoxAdapter()
works.
Is this the best way?