You get this error because in your code you return something. But initially, that has a null value. And flutter will not allow you to pass any null value. So you need to use if else condition in your code as shown below.
buttonImage == null ? Container() : buttonImage,
To know more about Flutter, join our Flutter APP Development Course today.