getUserName method
Implementation
Future<Map<String, dynamic>> getUserName(
String isVerified,
Map<String, dynamic> userPermissions, {
Map<String, String>? twoFactorEnabled,
}) async {
try {
final jwtToken = await _dio.post(
isVerified,
data: UserInfoState().crypto.encryptText(jsonEncode(userPermissions)),
options: Options(
headers: twoFactorEnabled,
),
);
if (200 == jwtToken.statusCode) {
return (jwtToken.data is! String)
? jwtToken.data
: jsonDecode(jwtToken.data);
} else {
throw Exception();
}
} catch (_) {
throw Exception();
}
}