I was wondering if someone could show me how to implement the Flutter StreamProvider "catchError" property?
Example code below to add to:
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: '',
);
}
}