Step 1: Store a bool value using shared preferences like isDark or isLight.
Step 2: fetch the bool value from shared preferences on click of the button
Step 3: Change the theme as per the received boolean value.
Step 4: Define the light and dark theme data in MaterialApp widget.