File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ //This extension has been made by abuanwar072
2
+ // The code has been taken from there
3
+ //It helps in creating a 3D effect to the widgets.
4
+
5
+ import 'package:flutter/material.dart' ;
6
+
7
+ extension Neumorphism on Widget {
8
+ addNeumorphism ({
9
+ double borderRadius = 10.0 ,
10
+ Offset offset = const Offset (5 , 5 ),
11
+ double blurRadius = 10 ,
12
+ Color topShadowColor = Colors .white60,
13
+ Color bottomShadowColor = const Color (0x26234395 ),
14
+ }) {
15
+ return Container (
16
+ decoration: BoxDecoration (
17
+ borderRadius: BorderRadius .all (Radius .circular (borderRadius)),
18
+ boxShadow: [
19
+ BoxShadow (
20
+ offset: offset,
21
+ blurRadius: blurRadius,
22
+ color: bottomShadowColor,
23
+ ),
24
+ BoxShadow (
25
+ offset: Offset (- offset.dx, - offset.dx),
26
+ blurRadius: blurRadius,
27
+ color: topShadowColor,
28
+ ),
29
+ ],
30
+ ),
31
+ child: this ,
32
+ );
33
+ }
34
+ }
You can’t perform that action at this time.
0 commit comments