diff --git a/example/lib/main.dart b/example/lib/main.dart index 3748b83..6954c91 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -53,9 +53,9 @@ class _HomePageState extends State { child: SoftEdgeBlur( edges: _selectedEdges.map((edge) { return EdgeBlur( - edge, - _edgeSize, - _blurSigma, + type: edge, + size: _edgeSize, + sigma: _blurSigma, controlPoints: controlPointsPerEdge[edge]!, ); }).toList(), diff --git a/lib/src/edge_blur.dart b/lib/src/edge_blur.dart index 5e1382e..472a49e 100644 --- a/lib/src/edge_blur.dart +++ b/lib/src/edge_blur.dart @@ -4,10 +4,10 @@ import 'edge_type.dart'; /// Defines the blur effect to be applied on a specific edge. class EdgeBlur { /// Creates an [EdgeBlur] effect for a specific edge with the given parameters. - const EdgeBlur( - this.type, - this.size, - this.sigma, { + const EdgeBlur({ + required this.type, + required this.size, + required this.sigma, required this.controlPoints, }); diff --git a/test/soft_edge_blur_godel_test.dart b/test/soft_edge_blur_godel_test.dart index 10de732..92cf28b 100644 --- a/test/soft_edge_blur_godel_test.dart +++ b/test/soft_edge_blur_godel_test.dart @@ -44,9 +44,9 @@ void main() { body: SoftEdgeBlur( edges: [ EdgeBlur( - EdgeType.topEdge, - 30.0, - 20.0, + type: EdgeType.topEdge, + size: 30.0, + sigma: 20.0, controlPoints: [ ControlPoint( position: 0.5, @@ -83,9 +83,9 @@ void main() { child: SoftEdgeBlur( edges: [ EdgeBlur( - EdgeType.bottomEdge, - 50.0, - 10.0, + type: EdgeType.bottomEdge, + size: 50.0, + sigma: 10.0, controlPoints: [ ControlPoint( position: 1.0, @@ -123,9 +123,9 @@ void main() { child: SoftEdgeBlur( edges: [ EdgeBlur( - EdgeType.leftEdge, - 50.0, - 10.0, + type: EdgeType.leftEdge, + size: 50.0, + sigma: 10.0, controlPoints: [ ControlPoint( position: 0.5, @@ -163,9 +163,9 @@ void main() { child: SoftEdgeBlur( edges: [ EdgeBlur( - EdgeType.rightEdge, - 50.0, - 10.0, + type: EdgeType.rightEdge, + size: 50.0, + sigma: 10.0, controlPoints: [ ControlPoint( position: 0.5, @@ -203,9 +203,9 @@ void main() { child: SoftEdgeBlur( edges: [ EdgeBlur( - EdgeType.topEdge, - 30.0, - 20.0, + type: EdgeType.topEdge, + size: 30.0, + sigma: 20.0, controlPoints: [ ControlPoint( position: 0.5, @@ -218,9 +218,9 @@ void main() { ], ), EdgeBlur( - EdgeType.leftEdge, - 50.0, - 10.0, + type: EdgeType.leftEdge, + size: 50.0, + sigma: 10.0, controlPoints: [ ControlPoint( position: 0.5, @@ -233,9 +233,9 @@ void main() { ], ), EdgeBlur( - EdgeType.bottomEdge, - 50.0, - 10.0, + type: EdgeType.bottomEdge, + size: 50.0, + sigma: 10.0, controlPoints: [ ControlPoint( position: 1.0, @@ -248,9 +248,9 @@ void main() { ], ), EdgeBlur( - EdgeType.rightEdge, - 50.0, - 10.0, + type: EdgeType.rightEdge, + size: 50.0, + sigma: 10.0, controlPoints: [ ControlPoint( position: 0.5, diff --git a/test/soft_edge_blur_test.dart b/test/soft_edge_blur_test.dart index 9ea2fe2..1e85b5d 100644 --- a/test/soft_edge_blur_test.dart +++ b/test/soft_edge_blur_test.dart @@ -12,9 +12,9 @@ void main() { body: SoftEdgeBlur( edges: [ EdgeBlur( - EdgeType.topEdge, - 10.0, - 5.0, + type: EdgeType.topEdge, + size: 10.0, + sigma: 5.0, controlPoints: [ ControlPoint( position: 0.0, @@ -27,9 +27,9 @@ void main() { ], ), EdgeBlur( - EdgeType.bottomEdge, - 10.0, - 5.0, + type: EdgeType.bottomEdge, + size: 10.0, + sigma: 5.0, controlPoints: [ ControlPoint(position: 0.0, type: ControlPointType.visible), ControlPoint( @@ -66,9 +66,9 @@ void main() { body: SoftEdgeBlur( edges: [ EdgeBlur( - EdgeType.topEdge, - 10.0, - 5.0, + type: EdgeType.topEdge, + size: 10.0, + sigma: 5.0, controlPoints: [ ControlPoint( position: 0.0, @@ -81,9 +81,9 @@ void main() { ], ), EdgeBlur( - EdgeType.topEdge, // Duplicate edge type - 20.0, - 10.0, + type: EdgeType.topEdge, // Duplicate edge type + size: 20.0, + sigma: 10.0, controlPoints: [ ControlPoint( position: 0.0,