我使用ColorScheme.light
它是因为它有primary
, primaryVariant
,secondary
和secondaryVariant
. 但是当我使用Theme.of(Context).colorScheme.primary
容器的颜色时,它并没有显示我设置的原色ColorScheme.light
。有谁知道解决方案?谢谢你
ThemeData(
colorScheme: ColorScheme.light(
primary: Colors.lightGreen.shade50,
primaryVariant: Colors.lightGreen.shade100,
secondary: Colors.deepPurple.shade50,
secondaryVariant: Colors.deepPurple.shade100,
),
Container(
color: Theme.of(context).colorScheme.secondary,
width: double.infinity,
height: 100,
),
容器颜色的图像不是原色