conditionalBorderRadius method

Container conditionalBorderRadius({
  1. bool topLeft = false,
  2. bool topRight = false,
  3. bool bottomLeft = false,
  4. bool bottomRight = false,
  5. double radius = 12.0,
})

条件圆角 - 可控制每个角

Implementation

Container conditionalBorderRadius({
  bool topLeft = false,
  bool topRight = false,
  bool bottomLeft = false,
  bool bottomRight = false,
  double radius = 12.0,
}) {
  return Container(
    decoration: BoxDecoration(
      borderRadius: BorderRadius.only(
        topLeft: topLeft ? Radius.circular(radius) : Radius.zero,
        topRight: topRight ? Radius.circular(radius) : Radius.zero,
        bottomLeft: bottomLeft ? Radius.circular(radius) : Radius.zero,
        bottomRight: bottomRight ? Radius.circular(radius) : Radius.zero,
      ),
    ),
    child: this,
  );
}