flutter 中用边框实现三角形

Container(
  width: 24,
  height: 0,
  decoration: new BoxDecoration(
    border: Border(
      // 四个值 top right bottom left
      bottom: BorderSide(
          color: Colors.white,
          width: ScreenUtil().setHeight(16),
          style: BorderStyle.solid),
      right: BorderSide(
          color: Colors.transparent,
          width: 12,
          style: BorderStyle.solid),
      left: BorderSide(
          color: Colors.transparent,
          width: 12,
          style: BorderStyle.solid),
    ),
  ),
),

你可能感兴趣的:(flutter 中用边框实现三角形)