【发布时间】:2020-11-05 02:14:35
【问题描述】:
我正在尝试将用户的身份验证 ID 推送到实时数据库,以便同时轻松获取它们,但实时数据库继续在 UUID 下生成 ID。
Future<http.Response> createUserProfile(
String id,
String email,
String userName,
) async {
return await http.post(
ServiceKeys.FIREBASE_URL + "/users/$id.json",
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
},
body: jsonEncode(<String, String>{'name': userName, 'email': email}),
);
}
}
我不想生成“-MCHpnJZnKvth-L89axu”。而是直接将其写入我提供的 id 中。
【问题讨论】:
标签: json flutter post dart firebase-realtime-database