在尝试使用Firebase中的动态地图使用flutter_mentions时遇到问题

问题描述

我正在尝试使用Flutter_mentions插件来处理Firebase中的数据。该示例仅显示手动输入的静态虚拟数据,因此我尝试动态获取数据。

这就是我现在所拥有的。如何从用户参考中查询userId,username和profileUrl并将其提供给data:[]映射?他们还提到了uggestinationBuilder也可以使用。

var data = Firestore.instance.collection('users').getDocuments();


child: FlutterMentions(
                decoration: Inputdecoration(
                  contentPadding: const EdgeInsets.only(left: 8.0),labelText: "Write comment here!",labelStyle: TextStyle(color: Colors.grey),enabledBorder: UnderlineInputBorder(
                      borderSide: BorderSide(color: Colors.grey)),focusedBorder: UnderlineInputBorder(
                      borderSide: BorderSide(color: Colors.grey)),),style: TextStyle(color: Colors.black),keyboardType: TextInputType.multiline,suggestionPosition: SuggestionPosition.Top,maxLines: null,minLines: 1,mentions: [
                  Mention(
                    trigger: "@",style: TextStyle(color: Colors.blue),data: [
                      {
                        "id": "61as61fsa","display": "fayeedP","photo":
                            "https://images.pexels.com/photos/220453/pexels-photo-220453.jpeg"
                      },{
                        "id": "61asasgasgsag6a","display": "khaled","photo":
                            "https://images.pexels.com/photos/220453/pexels-photo-220453.jpeg",},],trailing: [
                  OutlineButton(
                    onpressed: saveComment,borderSide: BorderSide.none,child: Text(
                      "Publish",style: TextStyle(
                          color: Colors.blue,fontWeight: FontWeight.bold),

请让我知道是否遗漏了重要事项。任何帮助是极大的赞赏。谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)