如何将自定义阴影颜色设置为RawMaterialButton?

时间:2020-05-25 05:56:48

标签: flutter

如果将RawMaterialButton包装到Material小部件中并设置shadowColor,它将无法正常工作:

@override
  Widget build(BuildContext context) => Material(
      shadowColor: AppColors.accentPrimary_40,
      type: MaterialType.transparency,
      child: RawMaterialButton(
          elevation: elevation,
          highlightElevation: 8,
          fillColor: onPressed != null ? AppColors.accentPrimary : AppColors.grey93,
          highlightColor: AppColors.accentPrimary_40,
          padding: padding,
          child: child(label),
          onPressed: onPressed,
          shape: const RoundedRectangleBorder(
            borderRadius: const BorderRadius.all(const Radius.circular(8)),
          ),
        ),
  );

0 个答案:

没有答案