fayeed/flutter_mentions

On tap is not working even after wraping in Gesture Detector

Opened this issue · 4 comments

I have implemented the flutter mentions, everything is working fine but when suggestion are shown and tapping on any of the suggestion is not working, Here is my code

Portal(
child: FlutterMentions(
key: key,
suggestionPosition: SuggestionPosition.Top,
maxLines: 5,
minLines: 1,
decoration: InputDecoration(hintText: 'hello'),
mentions: [
Mention(
trigger: '@',
style: TextStyle(
color: Colors.amber,
),
data: [
{
'id': '61as61fsa',
'display': 'fayeedP',
'full_name': 'Fayeed Pawaskar',
'photo':
'https://images.pexels.com/photos/220453/pexels-photo-220453.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940'
},
{
'id': '61asasgasgsag6a',
'display': 'khaled',
'full_name': 'DJ Khaled',
'style': TextStyle(color: Colors.purple),
'photo':
'https://images.pexels.com/photos/220453/pexels-photo-220453.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940'
},
{
'id': 'asfgasga41',
'display': 'markT',
'full_name': 'Mark Twain',
'photo':
'https://images.pexels.com/photos/220453/pexels-photo-220453.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940'
},
{
'id': 'asfsaf451a',
'display': 'JhonL',
'full_name': 'Jhon Legend',
'photo':
'https://images.pexels.com/photos/220453/pexels-photo-220453.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940'
},
],
matchAll: false,
suggestionBuilder: (data) {
return GestureDetector(
onTap: (){
debugPrint('On tap occured');
},
child: Padding(
padding: EdgeInsets.all(10.0),
child: Row(
children: [
GestureDetector(
onTap: (){
debugPrint('ON TAP');
},
child: CircleAvatar(
backgroundImage: NetworkImage(
data['photo'],
),
),
),
SizedBox(
width: 20.0,
),
Column(
children: [
Text(data['full_name']),
Text('@${data['display']}'),
],
)
],
),
),
);
}),
Mention(
trigger: '#',
disableMarkup: true,
style: TextStyle(
color: Colors.blue,
),
data: [
{'id': 'reactjs', 'display': 'reactjs'},
{'id': 'javascript', 'display': 'javascript'},
],
matchAll: true,
)
],
),
),

The same problem facing me too.

add Portal widget above MaterialApp. It works

where exactly need to add Portal? @sathi-007