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-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{4})$')
      .hasMatch(value!);
}