encodeToBase64 method

String encodeToBase64(
  1. List<Object?> objects
)

Encodes a list of objects to a Base64 string after JSON serialization.

objects: The list of objects to encode. Returns a Base64-encoded string. Note: This is not a cryptographic hash; it’s a reversible encoding.

Implementation

String encodeToBase64(List<Object?> objects) {
  final payload = json.encode(objects);
  final payloadBytes = utf8.encode(payload);
  return base64.encode(payloadBytes);
}