flutter - 不从 Firestore 获取帖子
问题描述
我正在尝试从 firebase 获取最新帖子。但是,它们不会出现在应用程序中。这可能是什么原因?帖子已注册并上传到 Firestore,但不会出现在应用程序中。
@override
Widget build(BuildContext context) {
return ListView(
shrinkWrap: true,
padding: EdgeInsets.symmetric(horizontal: 10.0),
children: [
if (isBannerAdReady)
Align(
alignment: Alignment.topCenter,
child: Container(
width: bannerAd.size.width.toDouble(),
height: bannerAd.size.height.toDouble(),
child: AdWidget(ad: bannerAd),
),
),
StreamBuilderWrapper(
shrinkWrap: true,
stream: postRef.orderBy('timestamp', descending: true).snapshots(),
physics: NeverScrollableScrollPhysics(),
itemBuilder: (_, DocumentSnapshot snapshot) {
Review posts = Review.fromJson(snapshot.data());
return Padding(
padding: const EdgeInsets.only(bottom: 12.0),
child: Posts(post: posts),
);
},
),
],
);
}
非常感谢帮助!
编辑:我怀疑它与用户名有关,它是西里尔字母。编辑个人资料并将用户名设置为拉丁字母,它起作用了。为什么?Firebase 不识别西里尔字母?
解决方案
推荐阅读
- c# - MQQueueManager 消息池
- java - 从 makefile 中的 src 和 res 文件夹编译 Jar 文件
- asp.net - 在 IIS express 中运行相同的应用程序引发错误
- amazon-web-services - 我应该将什么作为 CodeBuild 的 SecurityGroup?
- java - 带有 Spring WebFlow 的 Google reCAPTCHA
- python - TypeError:预期的 str、字节或 os.PathLike 对象,而不是元组
- mysql - 插入忽略或替换忽略不起作用
- jquery - 日期时间选择器问题
- reactjs - TypeError:this.state.patients.map 不是函数
- apache-spark - spark 独立模式通过 spark.driver.extraJavaOptions