Reputation: 1955
I'm pushing a screen with fullscreenDialog set to true. There is a cancel icon added to the top left. I want to replace this cancel icon with my own icon and functionality (delete). How can I override that icon?
Upvotes: 3
Views: 1624
Reputation: 2220
appBar: AppBar(
title: Text(AppLocalizations.of(context)!.profile),
leading: null,
leadingWidth: 0,
)
Upvotes: -1
Reputation: 840
appBar: AppBar(
title: Text("2nd page"),
leading: Container()
)
If you want the button hidden.
Upvotes: 1
Reputation: 267514
You need to use leading
property of AppBar
to override that X button. See below example:
appBar: AppBar(
title: Text("2nd page"),
leading: IconButton(
icon: Icon(Icons.delete),
onPressed: (){
// handle delete here
}),
)
Upvotes: 2