import 'package:cloud_functions/cloud_functions.dart'; Future> makeCloudCall( String callName, Map input, ) async { try { final response = await FirebaseFunctions.instance .httpsCallable(callName, options: HttpsCallableOptions()) .call(input); return response.data is Map ? Map.from(response.data as Map) : {}; } on FirebaseFunctionsException catch (e) { print( 'Cloud call error!\n' 'Code: ${e.code}\n' 'Details: ${e.details}\n' 'Message: ${e.message}', ); return {}; } }