Skip to content

Commit

Permalink
Merge pull request #8 from Rahiche/make-all-EdgeBlur-fields-named
Browse files Browse the repository at this point in the history
Make EdgeBlur fields named
  • Loading branch information
Rahiche authored Sep 17, 2024
2 parents 3a45faa + b03783a commit 1fa71cd
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 43 deletions.
6 changes: 3 additions & 3 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ class _HomePageState extends State<HomePage> {
child: SoftEdgeBlur(
edges: _selectedEdges.map((edge) {
return EdgeBlur(
edge,
_edgeSize,
_blurSigma,
type: edge,
size: _edgeSize,
sigma: _blurSigma,
controlPoints: controlPointsPerEdge[edge]!,
);
}).toList(),
Expand Down
8 changes: 4 additions & 4 deletions lib/src/edge_blur.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});

Expand Down
48 changes: 24 additions & 24 deletions test/soft_edge_blur_godel_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
24 changes: 12 additions & 12 deletions test/soft_edge_blur_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 1fa71cd

Please sign in to comment.