Flutter Back button with return data

后端 未结 11 1025
长情又很酷
长情又很酷 2020-12-01 15:46

I have an interface with two buttons that pop and return true or false, like so:

onPressed: () => Navigator.pop(context, false)

I need t

11条回答
  •  孤城傲影
    2020-12-01 16:19

    The default BackButton takes over the leading property of your AppBar so all you need to do is to override the leading property with your custom back button, for example:

    leading: IconButton(icon:Icon(Icons.chevron_left),onPressed:() => Navigator.pop(context, false),),)
    

提交回复
热议问题