base64Validate function

bool base64Validate(
  1. String? value
)

Implementation

bool base64Validate(String? value) {
  assert(value != null, 'expected non-null & non-empty base64 input.');
  return RegExp(
    r'^(?:[A-Za-z\d+/]{4})*(?:[A-Za-z\d+/]{2}==|[A-Za-z\d+/]{3}=|[A-Za-z\d+/]{4})$',
  ).hasMatch(value!);
}