Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update theme.dart #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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