The darkTheme property is currently always applied when the underlying platform wants to be dark — and it *only* applies when the underlying platform wants to be dark. You may want to do something like:
MaterialApp(
theme: myBlocWantsLight ? lightTheme : darkTheme,
darkTheme: myBlocAllowsDark ? darkTheme : null,
);
The above snippet assumes that you are incorporating your BLoC somewhere around the MaterialApp such that you can ask your BLoC what it wants. Then it asks your BLoC two questions. First, your regular theme is set to either light or dark based on what your BLoC wants, regardless of what the Android platform wants. The second question is applied to “darkTheme”, where your BLoC is given the opportunity to outright block the use of a dark theme, even if Android wants it to be dark. If you always want to respect what Android asks for, then you can simplify the above snippet to the following:
MaterialApp(
theme: myBlocWantsLight ? lightTheme : darkTheme,
darkTheme: darkTheme,
);