HayesGordon / chatter

Demo chat application using Stream Chat Core
106 stars 85 forks source link

Update theme.dart #9

Open WallaceHolanda opened 1 year ago

WallaceHolanda commented 1 year ago

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