This App shows how to implement a settings screen where the user can choose whether to use dark mode, light mode or system mode and persist it in SharedPreferences.
This app uses the ChangeNotifier and the provider package in order to notify the Material App Widget about theme changes.
Either connect a device, start ios simulator or start a Android emulator. Afterwards run this command from the root of the project flutter run
or flutter run -d <device_id>
from the root of the project.