Problem with thememode in flutter

Job ID: 35872987

Budget: $10 – $11 USD

I am trying to add dark and light mode to my app and it's working but the problem that when I press the button it's taking me to the first page in the app don't know why, you can find screenshot for all codes here in attachments,
note my budget is only 10 $
Related categories: Mobile App Development Flutter