isBase64 method

bool isBase64(
  1. String value
)

Checks if the string is a valid base64 string.

Parameters:

  • value The string to be checked.

Returns:

A boolean indicating whether the string is valid base64.

Implementation

bool isBase64(String value) {
  try {
    base64Decode(value);
    return true;
  } catch (e) {
    return false;
  }
}