backup method
Implementation
Future<void> backup(
{required String email,
required String pin,
required Uint8List ciphertext,
Function(Object)? onError,
Function()? onSuccess}) =>
_auth(_accessToken(), onError, (token, onError) {
RegExp pinCheck = RegExp(r'[0-9]{6,}$');
if (!pinCheck.hasMatch(pin)) {
throw ArgumentError('pin must be 6+ digits');
}
return _repository.add(
client: _client,
accessToken: token,
body: TikiBkupModelAddReq(
email: _hash(email),
pin: _hash(pin),
ciphertext: base64.encode(ciphertext)),
onSuccess: onSuccess,
onError: onError);
});