Navigator 1.0 apps: build the root widget (which contains the MaterialApp) for a theme mode.
MaterialApp
typedef RootBuilder = Widget Function({required ThemeMode themeMode});