Example of Creating Drop Shadow Effect Text in FLUTTER DART

Hello friends, One of our user once ask me to make tutorial on the Shadow Effect Text topic. So I though why be late, let’s make it. So I start learning about How I can put drop shadow effect text in flutter. Then I found that in Flutter we can make this quite easily. All we have to do is first make 1 Text widget then in the TextStyle property we would use the Shadow widget directly. Shadow widget will construct a Shadow effect around the text widget. The default shadow effect color is Black. So in this tutorial we would learn about Example of Creating Drop Shadow Effect Text in FLUTTER DART.

Contents in this project Example of Creating Drop Shadow Effect Text in FLUTTER DART :-

1. Open your project’s main.dart file and import material.dart package.

2. Creating void main runApp() method. Here we would call our main MyApp widget class.

3. Creating our main App extends StatelessWidget class.

4. Now we would make the Text widget along with Shadow widget with its Child to make the Drop Shadow Effect.

Shadow Widget properties :-

  1. blurRadius :-The standard deviation of the Gaussian to convolve with the shadow’s shape.
  2. color :- Color of Shadow.
  3. offset :- The displacement of the shadow from the casting element. Positive x/y offsets will shift the shadow to the right and down, while negative offsets shift the shadow to the left and up. The offsets are relative to the position of the element that is casting it.

5. Complete source code for main.dart file :-

Screenshot :-

Example of Creating Drop Shadow Effect Text in FLUTTER DART

Leave a Reply

Your email address will not be published. Required fields are marked *