Skip to content

Commit fa36c69

Browse files
authored
Merge pull request #2 from Rahiche/update-readme
Update the read me to reflect the new changes
2 parents ad14d65 + 40e3b07 commit fa36c69

File tree

3 files changed

+53
-28
lines changed

3 files changed

+53
-28
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.1.0
2+
* Multiple edges can now be applied simultaneously
3+
* re-implemented using a new technique using a single gradient mask and blur operation
4+
* Added control points to adjust the intensity of the gradient mask
5+
16
## 0.0.3
27
* add image and video demo.
38

README.md

+47-27
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
11
# SoftEdgeBlur
22

3-
A Flutter widget that applies a soft, blurred edge effect to its child widget. This package allows you to easily add a subtle, fading blur effect to the top and/or bottom edges of any widget, creating a smooth transition between content and background.
3+
A Flutter package that provides a customizable soft edge blur effect for widgets.
44

5-
<img width="547" alt="Screenshot 2024-09-10 at 23 04 14" src="https://github.com/user-attachments/assets/ba58e8a7-a499-46b0-8f41-6eb74dfb8738">
5+
<img width="547" alt="Map blurred" src="https://i.imgur.com/7DcixDz.png">
66

7+
## Example
8+
| ![](https://i.imgur.com/ZHTocas.png) | ![](https://i.imgur.com/ejYRoGu.png) |
9+
|--------------------------------------|--------------------------------------|
10+
| ![](https://i.imgur.com/2B4RJo2.png) | ![](https://i.imgur.com/lrVGtHU.png) |
711

8-
## Getting Started
9-
10-
To use this package, add `soft_edge_blur` as a dependency in your `pubspec.yaml` file.
11-
12-
```yaml
13-
dependencies:
14-
soft_edge_blur:
15-
```
16-
17-
Then, run:
18-
19-
```
20-
flutter pub get
21-
```
2212

2313
## Usage
2414

@@ -33,30 +23,60 @@ Wrap any widget with `SoftEdgeBlur` to apply the blur effect:
3323
```dart
3424
SoftEdgeBlur(
3525
edges: [
36-
EdgeBlur(EdgeType.topEdge, 20, 3),
26+
EdgeBlur(
27+
EdgeType.topEdge,
28+
100.0, // Edge Size
29+
20.0, // Blur Sigma
30+
controlPoints: [
31+
ControlPoint(position: 0.5, type: ControlPointType.visible),
32+
ControlPoint(position: 1.0, type: ControlPointType.transparent),
33+
],
34+
),
3735
],
3836
child: YourWidget(),
3937
)
4038
```
4139

42-
### Parameters
40+
## Customization
4341

44-
- `edges`: A list of `EdgeBlur` objects defining which edges to blur and their properties.
45-
- `child`: The widget to which the blur effect will be applied.
42+
You can customize the following properties for each edge:
4643

47-
Each `EdgeBlur` object takes three parameters:
48-
1. `EdgeType`: Either `EdgeType.topEdge` or `EdgeType.bottomEdge`
49-
2. `size`: The size of the blurred area in logical pixels
50-
3. `sigma`: The intensity of the blur effect
44+
### Edge Type
5145

46+
Specify which edges to apply the blur effect:
5247

53-
## Demo
48+
- `EdgeType.topEdge`
49+
- `EdgeType.bottomEdge`
50+
- `EdgeType.leftEdge`
51+
- `EdgeType.rightEdge`
5452

55-
Check out this video to see `SoftEdgeBlur` in action:
53+
You can apply blur to multiple edges simultaneously.
5654

55+
### Edge Size
5756

57+
Set the size of the blurred area. This determines how far the blur effect extends from the edge of the widget.
5858

59+
### Blur Sigma
5960

60-
https://github.com/user-attachments/assets/e42d79ab-657d-4a1b-90be-5fbd44f1a957
61+
Adjust the intensity of the blur effect.
6162

63+
### Control Points
6264

65+
Define points to control the blur gradient along the edge. Each control point has two properties:
66+
67+
- `position`: A value between 0.0 and 1.0, representing the position along the edge.
68+
- `type`: Either `ControlPointType.visible` or `ControlPointType.transparent`.
69+
70+
71+
### Example Configuration
72+
73+
```dart
74+
EdgeBlur(
75+
EdgeType.topEdge,
76+
100.0, // Edge Size
77+
20.0, // Blur Sigma
78+
controlPoints: [
79+
ControlPoint(position: 0.5, type: ControlPointType.visible),
80+
ControlPoint(position: 1.0, type: ControlPointType.transparent),
81+
],
82+
),

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: soft_edge_blur
22
description: "A customizable Flutter widget that applies a soft blur effect to one or more edges of its child widget."
3-
version: 0.0.2
3+
version: 0.1.0
44
repository: https://github.com/Rahiche/soft_edge_blur
55

66
environment:

0 commit comments

Comments
 (0)