【问题标题】:How to retrieve all data from firebase realtime database in flutter如何在flutter中从firebase实时数据库中检索所有数据
【发布时间】:2019-05-24 23:23:36
【问题描述】:

我正在尝试从具有多个子项的实时数据库中检索所有数据

如何检索所有数据。既是住宿也是产品?

这就是我为它们单独获取的方式:

http.get(
        'https://flutter-buy.firebaseio.com/products.json?auth=${_authenticatedUser.token}')

我试过了,但没有用:

http.get(
        'https://flutter-buy.firebaseio.com.json?auth=${_authenticatedUser.token}')

【问题讨论】:

    标签: firebase firebase-realtime-database dart flutter


    【解决方案1】:

    您是否尝试过在请求中不指定产品或住宿节点,如下所示(注意.json):

    http.get( 'https://flutter-buy.firebaseio.com/.json?auth=${_authenticatedUser.token}')
    

    看来可以看看他们的documentation

    【讨论】:

    • 这确实是诀窍:您需要在.json 之前添加一个/,否则它会成为域名的一部分。
    猜你喜欢
    • 2021-02-06
    • 1970-01-01
    • 1970-01-01
    • 2021-10-16
    • 2018-09-11
    • 1970-01-01
    • 2020-12-11
    • 2021-11-02
    相关资源
    最近更新 更多