Flutter: Drop Shadow Effect for Image.
Today we are going to look at how to achieve image drop shadow in Flutter.
Image Drop Shadow effect is basically a cool effect in which shadow of image depicts image in blurred format.
So lets get started…
- First of all create a flutter project name it drop-shadow-example and delete all of the contents of the main.dart file in lib directory.
- Now go to the pubspec.yaml file add under the dependency. `drop_shadow_image: ^0.9.1`
- Create images dir and place a image inside with name “example”. Now add code for your asset for the image in the pubspec.yaml or You can also add image using network.
- after adding asset in pubspec.yaml. the file will look like this…
5. The drop_shadow_image comes with a Class DropShadowImage. The class have some properties which can be used to make the full potential of the package, let’s have look at these properties and then we will use it…
6. Now come to main.dart and lets write code below for the effect using the package we added.
for Image.asset():
for Image.network:
Conclusion
Using drop_shadow_image
You can apply drop shadow to image depicting image very easily with full performance. The package supports Android, IOS, MacOS, Windows, Linux and Web.
for the reference you can look at the the link to GitHub.
Thank You!