如果将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)),
),
),
);