📌  相关文章
📜  参数类型“颜色?”不能分配给参数类型“MaterialColor?” - 飞镖代码示例

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

代码示例1
MaterialColor swatchify(MaterialColor color, int value) {
  return MaterialColor(color[value].hashCode, {
    50: color[value],
    100: color[value],
    200: color[value],
    300: color[value],
    400: color[value],
    500: color[value],
    600: color[value],
    700: color[value],
    800: color[value],
    900: color[value],
  });
}

primarySwatch: swatchify(Colors.purple, 900),