dio and login functions

This commit is contained in:
mohammad
2024-07-21 15:09:51 +03:00
parent 2e678388fb
commit 9d5eba6870
16 changed files with 34 additions and 41 deletions

View File

@ -0,0 +1,21 @@
import 'dart:convert';
String decodeBase64(String str) {
//'-', '+' 62nd char of encoding, '_', '/' 63rd char of encoding
String output = str.replaceAll('-', '+').replaceAll('_', '/');
switch (output.length % 4) {
// Pad with trailing '='
case 0: // No pad chars in this case
break;
case 2: // Two pad chars
output += '==';
break;
case 3: // One pad char
output += '=';
break;
default:
throw Exception('Illegal base64url string!"');
}
return utf8.decode(base64Url.decode(output));
}