safeCall<T> function
Implementation
Future<T?> safeCall<T>(Future<T> future, [BuildContext? context]) async {
try {
var result = await future;
return result;
} catch (error) {
if (context != null) {
showServerError(context, error: error);
}
}
return null;
}