Flutter 尝试使用Firebase的动态地图时出现问题
我正在尝试使用flatter_-indications插件来处理我在Firebase中拥有的数据。该示例仅显示手动输入的静态虚拟数据,因此我尝试动态获取数据 这就是我现在拥有的。如何从用户引用中查询userId、username和profileUrl,并将其提供给数据:[]映射?他们还提到suggestionBuilder也可以使用Flutter 尝试使用Firebase的动态地图时出现问题,flutter,google-cloud-firestore,mention,Flutter,Google Cloud Firestore,Mention,我正在尝试使用flatter_-indications插件来处理我在Firebase中拥有的数据。该示例仅显示手动输入的静态虚拟数据,因此我尝试动态获取数据 这就是我现在拥有的。如何从用户引用中查询userId、username和profileUrl,并将其提供给数据:[]映射?他们还提到suggestionBuilder也可以使用 var data = Firestore.instance.collection('users').getDocuments(); child: Flutter
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),
),
),
],
),
如果我遗漏了什么重要的东西,请告诉我。非常感谢您的帮助。谢谢