updateUserMetadata method
Implementation
Future<Map<String, dynamic>?> updateUserMetadata(
String token, Map<String, dynamic> metadata) async {
// Convert metadata map to URL-encoded form string
String formData = metadata.keys
.map((key) =>
"${Uri.encodeComponent(key)}=${Uri.encodeComponent(metadata[key].toString())}")
.join("&");
final response = await http.post(
Uri.parse('$webbaseUrl/api/ibl/v1/users/manage/metadata/'),
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': 'Bearer $token',
},
body: formData,
);
var data = json.decode(response.body);
return data; // Returns the API response
}