Hi,
I am using StreamProvider.value, but am struggling to find any examples online of how to use the "catchError" property! I have the official documentation, but can't manage to link this to a real world example.
I was wondering if you could show me how to implement a "catchError" property below in yellow. See example code.
StreamProvider<LocationModelNormal>.value(
initialData: LocationModelNormal.initialData(),
stream: locationStreamInstance.specificLocation(_secondWonder),
catchError: ?????????
),
class LocationModelNormal {
final String name;
LocationModelNormal({
this.name
});
factory LocationModelNormal.fromMap(Map<String, dynamic> data) {
return LocationModelNormal(
name: data['name'] ?? '',
);
}
factory LocationModelNormal.initialData() {
return LocationModelNormal(
name: '',
);
}
}