leonardocaldas / flutter-polygon-clipper

Flutter Custom Clipper using Polygon shapes
GNU General Public License v3.0
96 stars 31 forks source link

Extend OutlinedBorder for use in Chip with flutter 2.0 #9

Closed wietsebuseyne closed 3 years ago

wietsebuseyne commented 3 years ago

In flutter 2.0, a Chip requires a OutlinedBorder. For this plugin to keep working with the Chip (and potentially other) classes, the PolygonBorderclass should extend OutlinedBorder.

I implemented and tested the change. I will create a pull-request later tomorrow.

The necessary changes are:

  1. extend OutlinedBorder instead of ShapeBorder
  2. use the OutlinedBorder side variable instead of the border variable that is used right now
  3. implement copyWith:
    @override
    OutlinedBorder copyWith({BorderSide side}) {
    if (side == null) return this;
    return PolygonBorder(
      sides: sides,
      side: side,
      rotate: rotate,
      borderRadius: borderRadius,
    );
    }
wietsebuseyne commented 3 years ago

Fixed in https://github.com/leonardocaldas/flutter-polygon-clipper/pull/10