SideEffects<T>.onError constructor
SideEffects<T>.onError (
- void onError(
- dynamic err,
- VoidCallback refresh
- void initState()?,
- void dispose()?,
Side effect to be called when the state has error.
Implementation
factory SideEffects.onError(
void Function(dynamic err, VoidCallback refresh) onError, {
void Function()? initState,
void Function()? dispose,
}) {
return SideEffects(
initState: initState,
dispose: dispose,
onSetState: (snap) {
if (snap.hasError) {
onError(snap.snapError!.error, snap.snapError!.refresher);
}
},
);
}