Flutter Back button with return data

后端 未结 11 1006
长情又很酷
长情又很酷 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:39

    First, Remove the automatically appended back button (see this answer)

    Then, create your own back button. like this:

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

提交回复
热议问题