isBase64 property

bool get isBase64

Checks if the string is a valid Base64 encoded string.

Example:

print('SGVsbG8='.isBase64); // true

Implementation

bool get isBase64 =>
    RegExp(r'^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$').hasMatch(this);