-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
PopupMenuButton inside listview.builder showing on the incorrect place #89754
Comments
i have clicked on horis icon(3 dots) and it is showing popup at bottom. when scroll is not done and then when i click on icon then it shows popup on right place but after scroll is done it shows on wrong place Thanks |
Hi @bipindubey-technoark, you appear to be on an older version of the Also, there's a new version of Thank you |
Okay will try to update the flutter |
I have upgraded the flutter by running flutter upgrade command |
its not working after upgrading ,its giving build errors now i am switching the channel to stable and then will see the output. |
Hii @danagbemava-nc but not i am getting build error |
@danagbemava-nc i am getting this error |
flutter packages get |
Can you try clearing your Run this command to clear your cache: |
@danagbemava-nc I run above commands but nothing worked |
@danagbemava-nc should i switch to master channel |
it seems like this bug is fixed in master this is the same question #80869 (comment) and here they have version master, 2.3.0-1.0.pre.171. |
Check it out on master and let me know |
I switched to master and its not working @danagbemava-nc same issue is showing |
I using above version This is the error The plugins |
Hi @bipindubey-technoark, let me trouble you a little. Can you create a project and see if you're able to build it? If so, can you try copying over the files from the current project and see if you're able to build it? |
I have done that . its still not working |
@bipindubey-technoark, we seem to have gone off-topic for a bit. If
Kindly use a sample app to confirm if you're still experiencing this issue with any of the latest versions of flutter. Thank you |
Hii @danagbemava-nc
|
@danagbemava-nc Everyone are facing this issue after upgrading the flutter |
@bipindubey-technoark please provide a complete minimal reproducible sample. Thank you |
Just add popup in listviewbuilder. PopupMenu.dart
call that popupmenu in listview.builder
@danagbemava-nc Thanks |
@bipindubey-technoark The error says the issue is because of the This has been fixed in So running your app on flutter 2.5.0 should not be a problem |
@bipindubey-technoark, I had to make some changes to the snippets you provided because you had certain variables that I did not have. However, I am unable to reproduce the issue. This looks to me like the issue might be with how your layout is structured. See attached video. code sampleimport 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
home: HomeWidget(),
),
);
}
class HomeWidget extends StatelessWidget {
Widget getPopupMenu(actions) {
return Container(
alignment: Alignment.centerRight,
child: PopupMenuButton(
elevation: 50,
onSelected: (result) {
print(result);
},
itemBuilder: (context) {
var list = <PopupMenuEntry<Object>>[];
actions.asMap().forEach(
(index, action) => list.add(
PopupMenuItem(
value: index,
child: GestureDetector(
onTap: action['onTap'],
child: Row(children: [
Container(
margin: EdgeInsets.only(right: 12),
child: Icon(Icons.edit, color: Colors.blue),
),
Text(
action['text'],
style: TextStyle(color: Colors.blue),
),
]),
),
),
),
);
return list;
},
icon: Icon(
Icons.more_horiz,
size: 24,
color: Colors.blue,
),
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: ListView.builder(
shrinkWrap: true,
itemCount: 5,
itemBuilder: (BuildContext context, int index) {
return getPopupMenu(([
{
'icon': Icons.edit,
'text': 'Edit',
'onTap': () {
Navigator.pop(context, 0);
}
},
{
'icon': Icons.highlight_remove,
'text': 'Remove',
'onTap': () {
Navigator.pop(context, 1);
}
}
]));
},
),
);
}
}
videotelegram-cloud-document-4-5913596433839163611.mp4I would also like to point out that the reason we request for a If you feel that the sample I used is not enough to reproduce your issue, kindly provide a minimal complete reproducible code sample Thank you |
I have not used photoView package in my application how it can solve my problem? @maheshmnj I have added photo_view: ^0.12.0 in pubspec.yaml file i am getting this error now
|
Hii @danagbemava-nc just do 1 thing add atleast 30 items in listview or give padding between list so that there will be scroll. after scroll click on 3 dots icon. initiallly it shows popup on right position when we dont scroll Thank you |
Hi @bipindubey-technoark, I still cannot reproduce this issue. I made the number of items See attached video. telegram-cloud-document-4-5915776559238613499.mp4 |
@danagbemava-nc thanks for just confirmation i am sending my pubspec.yaml file can you try to change with this and then try again
|
Hi @bipindubey-technoark, even after adding the dependencies, I still cannot reproduce the issue.
As I stated here, if possible, please share the full layout that you have that contains the popupMenuButton, so that we can look at it and see if we can fix it. Thank you |
It is working now i dont know why. Thanks @danagbemava-nc for your time and help |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
I have popupmenu button for every item in listview
whenever i scroll the list and then click on the popupicon it shows popup on wrong place(mainly on bottom right)
This is my flutter version
Flutter 2.3.0-0.1.pre • channel dev
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel dev, 2.3.0-0.1.pre, on Microsoft Windows [Version 10.0.19042.1165], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] VS Code (version 1.60.0)
[√] Connected device (4 available)
• No issues found!
Please help me out @ianloic @anaisbetts @sgraham @gmoothart @sethladd
The text was updated successfully, but these errors were encountered: