listen method
Widget
listen({
- required Widget ready(
- T data
- Widget loading = const SizedBox(),
- Widget error(
- FutureManagerError error
Display nothing on loading
and error
Implementation
Widget listen({
required Widget Function(T data) ready,
Widget loading = const SizedBox(),
Widget Function(FutureManagerError error) error = EmptyErrorFunction,
}) {
return FutureManagerBuilder<T>(
futureManager: this,
ready: (context, data) => ready(data),
loading: loading,
error: error,
);
}