@@ -3,29 +3,6 @@ import 'dart:math';
33import 'package:flutter/material.dart' ;
44
55class OverlayShape extends ShapeBorder {
6- OverlayShape ({
7- this .borderColor = Colors .red,
8- this .borderWidth = 4.0 ,
9- this .overlayColor = const Color .fromRGBO (0 , 0 , 0 , 80 ),
10- this .borderRadius = 0 ,
11- this .borderLength = 42 ,
12- double ? cutOutSize,
13- double ? cutOutWidth,
14- double ? cutOutHeight,
15- this .cutOutBottomOffset = 0 ,
16- }) : cutOutWidth = cutOutWidth ?? cutOutSize ?? 250 ,
17- cutOutHeight = cutOutHeight ?? cutOutSize ?? 250 {
18- assert (
19- borderLength <=
20- min (this .cutOutWidth, this .cutOutHeight) / 2 + borderWidth * 2 ,
21- "Border can't be larger than ${min (this .cutOutWidth , this .cutOutHeight ) / 2 + borderWidth * 2 }" ,
22- );
23- assert (
24- (cutOutWidth == null && cutOutHeight == null ) ||
25- (cutOutSize == 0.0 && cutOutWidth != null && cutOutHeight != null ),
26- 'Use only cutOutWidth and cutOutHeight or only cutOutSize' );
27- }
28-
296 /// Color of the border.
307 final Color borderColor;
318
@@ -50,6 +27,29 @@ class OverlayShape extends ShapeBorder {
5027 /// Bottom offset of the cut out.
5128 final double cutOutBottomOffset;
5229
30+ OverlayShape ({
31+ this .borderColor = Colors .red,
32+ this .borderWidth = 4.0 ,
33+ this .overlayColor = const Color .fromRGBO (0 , 0 , 0 , 80 ),
34+ this .borderRadius = 0 ,
35+ this .borderLength = 42 ,
36+ double ? cutOutSize,
37+ double ? cutOutWidth,
38+ double ? cutOutHeight,
39+ this .cutOutBottomOffset = 0 ,
40+ }) : cutOutWidth = cutOutWidth ?? cutOutSize ?? 250 ,
41+ cutOutHeight = cutOutHeight ?? cutOutSize ?? 250 {
42+ assert (
43+ borderLength <=
44+ min (this .cutOutWidth, this .cutOutHeight) / 2 + borderWidth * 2 ,
45+ "Border can't be larger than ${min (this .cutOutWidth , this .cutOutHeight ) / 2 + borderWidth * 2 }" ,
46+ );
47+ assert (
48+ (cutOutWidth == null && cutOutHeight == null ) ||
49+ (cutOutSize == 0.0 && cutOutWidth != null && cutOutHeight != null ),
50+ 'Use only cutOutWidth and cutOutHeight or only cutOutSize' );
51+ }
52+
5353 @override
5454 EdgeInsetsGeometry get dimensions => const EdgeInsets .all (10 );
5555
0 commit comments