我想在firebase数据库密钥参数下推送由firebase auth生成的用户ID。有人可以帮忙吗?
我的数据结构代码:
class ExpenseData{
String key;
String category = 'other';
int exp;
ExpenseData(this.category, this.exp);
Object fromSnapShot(DataSnapshot snapshot) {
key = snapshot.key;
category = snapshot.value['category'];
exp = snapshot.value['exp'];
}
Future<String> getUserId() async{
FirebaseUser userNow = await FirebaseAuth.instance.currentUser();
return userNow.uid;
}
expJason(){
return{
"category": category,
'exp': exp,
};
}
}