title: How to fix this error with the return type in Flutter?
body: <p>A null safety error is shown in the dart file. How to fix this?</p>
  <p><a href="https://i.stack.imgur.com/3Y6EL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3Y6EL.png" alt="enter image description here" /></a></p>
  <p>[UPDATE]</p>
  <p>After I made any of the suggested changes below. I get this error. How do I fix this?
  <a href="https://i.stack.imgur.com/QTHKn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QTHKn.png" alt="Exception caught by widgets library" /></a></p>
  <p><a href="https://i.stack.imgur.com/JekW9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JekW9.png" alt="Error shown in emulator" /></a></p>