根据用户将Firebase UID推送到Firebase数据库过滤器数据

时间:2019-03-07 16:43:49

标签: firebase flutter firebase-authentication

我想在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,
 };
}

}

0 个答案:

没有答案