Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On tap is not working even after wraping in Gesture Detector #103

Open
SherazAli-67 opened this issue Apr 7, 2023 · 4 comments
Open

On tap is not working even after wraping in Gesture Detector #103

SherazAli-67 opened this issue Apr 7, 2023 · 4 comments

Comments

@SherazAli-67
Copy link

SherazAli-67 commented Apr 7, 2023

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

@SherazAli-67
Copy link
Author

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,
)
],
),
),

@Govindbetterlives
Copy link

The same problem facing me too.

@sathi-007
Copy link

add Portal widget above MaterialApp. It works

@asjad-appscrip
Copy link

asjad-appscrip commented Jul 11, 2024

where exactly need to add Portal? @sathi-007

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants