@@ -12,7 +12,6 @@ import 'package:flutter/material.dart';
1212class TechnoShapeBorder extends ShapeBorder {
1313 final Path outLinePath = Path ();
1414 final Paint _paint = Paint ();
15- final Path innerLinePath = Path ();
1615 final Path innerLinePathTop = Path ();
1716 final Color color;
1817
@@ -45,30 +44,30 @@ class TechnoShapeBorder extends ShapeBorder {
4544
4645 @override
4746 Path getOuterPath (Rect rect, {TextDirection textDirection}) {
47+ double width = rect.width;
48+
4849 outLinePath
4950 ..moveTo (cornerWidth, 0 )
50- ..lineTo (rect.width - cornerWidth, 0 )
51- ..lineTo (rect.width, cornerWidth)
52- ..lineTo (rect.width, rect.height - cornerWidth)
53- ..lineTo (rect.width - cornerWidth, rect.height)
54- ..lineTo (cornerWidth, rect.height)
55- ..lineTo (0 , rect.height - cornerWidth)
56- ..lineTo (0 , cornerWidth)
57- ..close ();
58- innerLinePath
59- ..moveTo (rect.width / 2 , rect.height)
60- ..relativeLineTo (rect.width * innerRate, 0 )
61- ..relativeLineTo (- spanWidth * 2 , - spanWidth)
51+ ..relativeLineTo (width - cornerWidth* 2 , 0 )
52+ ..relativeLineTo (cornerWidth, cornerWidth)
53+ ..relativeLineTo (0 ,rect.height - cornerWidth* 2 )
54+ ..relativeLineTo ( - cornerWidth, cornerWidth)
55+ ..relativeLineTo (- ((width- innerRate* 2 * width)/ 2 - cornerWidth- 2 * spanWidth), 0 )
56+ ..relativeLineTo (- spanWidth* 2 , - spanWidth)
6257 ..relativeLineTo (- rect.width * innerRate * 2 , 0 )
6358 ..relativeLineTo (- spanWidth * 2 , spanWidth)
59+ ..relativeLineTo (- ((width- innerRate* 2 * width)/ 2 - cornerWidth- 2 * spanWidth), 0 )
60+ ..lineTo (0 , rect.height - cornerWidth)
61+ ..lineTo (0 , cornerWidth)
6462 ..close ();
65- return Path .combine (PathOperation .difference, outLinePath, innerLinePath);
63+
64+ return outLinePath;
6665 }
6766
6867 @override
6968 void paint (Canvas canvas, Rect rect, {TextDirection textDirection}) {
7069 canvas.drawPath (
71- Path . combine ( PathOperation .difference, outLinePath, innerLinePath) ,
70+ outLinePath,
7271 _paint..style = PaintingStyle .stroke);
7372
7473 innerLinePathTop
@@ -78,7 +77,7 @@ class TechnoShapeBorder extends ShapeBorder {
7877 ..relativeLineTo (- rect.width * innerRate * 2 , 0 )
7978 ..relativeLineTo (- spanWidth * 2 , - spanWidth)
8079 ..close ();
81- canvas.drawPath (innerLinePathTop, _paint..style = PaintingStyle .fill);
80+ canvas.drawPath (innerLinePathTop. shift ( Offset (spanWidth * 2 , 0 )) , _paint..style = PaintingStyle .fill);
8281 }
8382
8483 @override
0 commit comments