我收到此错误:
'package:flutter/src/material/theme_data.dart': Failed assertion: line 412 pos 12: 'colorScheme?.brightness == null || brightness == null || colorScheme!.brightness == brightness': is not true.
在最近的更新之前,我已经使用了这个亮度:Brightness.dark 参数用于我的暗模式,没有任何问题。我一次更新了几件事,所以我不确定是什么导致了变化。我现在需要以不同的方式设置我的黑暗模式吗?
当前的黑暗主题:
darkTheme: ThemeData(
toggleableActiveColor: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
textTheme: _textTheme(),
colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(secondary: Colors.blueAccent),
brightness: Brightness.dark,
),