Skip to content

Conversation

@WallaceHolanda
Copy link

@WallaceHolanda WallaceHolanda commented Feb 20, 2023

I've used the brightness: Brightness.dark parameter for my dark mode without any problems until a recent flutter update (3.7.3). After the update, I'm getting this error:

'package:flutter/src/material/theme_data.dart': Failed assertion: line 412 pos 12: 'colorScheme?.brightness == null || brightness == null || colorScheme!.brightness == brightness': is not true.

This is a consequence of tightening up the ThemeData constructor the brightness parameter and the ColorScheme's brightness parameter in an update of Flutter. In this case,the brightness of the ColorScheme is light (the default), but the ThemeData's brightness is dark. So that, we need to remove the brightness parameter and put that in the colorScheme

I've used this brightness: Brightness.dark parameter for my dark mode without any problems until a recent flutter update (3.7.3). After the update, I'm getting this error:

'package:flutter/src/material/theme_data.dart': Failed assertion: line 412 pos 12: 'colorScheme?.brightness == null || brightness == null || colorScheme!.brightness == brightness': is not true.

This is a consequence of tightening up the ThemeData constructor the brightness parameter and the ColorScheme's brightness parameter in an update of Flutter. In this case,the brightness of the ColorScheme is light (the default), but the ThemeData's brightness is dark. So that, we need to remove the brightness parameter and put that in the colorScheme
@Aravindpr11 Aravindpr11 mentioned this pull request Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant