📜  颤动按钮样式 - 任何代码示例

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

代码示例2
ElevatedButton(
  style: ButtonStyle(
    backgroundColor: MaterialStateProperty.resolveWith(
      (Set states) {
        if (states.contains(MaterialState.pressed))
          return Theme.of(context).colorScheme.primary.withOpacity(0.5);
        return null; // Use the component's default.
      },
    ),
  ),
)