📌  相关文章
📜  构造函数返回不属于预期类型“MaterialColor”的“Color”类型. - 飞镖代码示例

📅  最后修改于: 2022-03-11 14:48:08.291000             🧑  作者: Mango

代码示例1
primarySwatch takes a ColorSwatch [which MaterialColor extends]. 
A swatch is a map of shades for a color (from [50] to [900]).

Colors.teal is a swatch, it includes all the different Color variations of teal,
of which teal[100] is just one.

Colors.teal[100] is an individual Color, it can't be assigned to a property that
expects a full swatch.

Hope this clarifies things, you can also take a look at the Colors documentation
(https://api.flutter.dev/flutter/material/Colors-class.html) for more details.