How to fix this Constant value error
actions: [
IconButton(
icon: Icon(
Icons.cancel,
color: Colors.red,
), onPressed: () {
Navigator.pop(context);
},
)
]
I have provided a code snippet for a Flutter application that includes an IconButton widget with an icon for the cancel button. When the button is pressed, the current screen is displayed using Navigator.pop(context)
How to implement pop from navigation layer ?
2
Answers
The problem is on your
AlertDialog
.You just need to remove
const
beforeAlertDialog
.There will be a const before the dialog box code. Please remove it.