-
Notifications
You must be signed in to change notification settings - Fork 28.6k
Leading in AppBar won't open drawer after I change Leading to an image #21238
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
Comments
Please consider asking support questions in one of the channels http://flutter.io/support . |
Can you provide a reduced reproduction (content of main.dart as a running example with everything not required to reduce the problem removed)? |
Well the leading widget does not automatically open the drawer. You have to create some kind of button or leading: Builder(builder: (BuildContext context) {
return IconButton(
icon: Icon(Icons.android),
onPressed: () {
Scaffold.of(context).openDrawer();
},
);
}), |
@sir-boformer Thanks, it does help. My final code works and it looks this: leading: Builder(builder: (BuildContext context) {
return new GestureDetector(
onTap: (){
Scaffold.of(context).openDrawer();
},
child: new Container(`
child: new Image.asset("assets/img/head.png"),
padding: new EdgeInsets.all(7.0),
),
);
}), |
Thanks, it works! |
|
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 |
Uh oh!
There was an error while loading. Please reload this page.
I want to change leading icon in AppBar to an image (user profile image). But after I change it, this leading image counldn't open drawer.
Here is my code:
I have no idea how to solve this problem.
So please help me.
The text was updated successfully, but these errors were encountered: