toBase64 function Null safety

String toBase64(
  1. dynamic request
)

Implementation

String toBase64(request) {
  String strJson = jsonEncode(request);
  var bytes = utf8.encode(strJson);
  var base64Str = base64Encode(bytes);
  return base64Str;
}