-
Notifications
You must be signed in to change notification settings - Fork 0
/
box_shadow.dart
98 lines (94 loc) · 2.38 KB
/
box_shadow.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import 'package:flutter/material.dart';
class Neumorphism extends StatelessWidget {
const Neumorphism({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.grey[300],
appBar: AppBar(
backgroundColor: Colors.grey[300],
title: const Text(
'Neumorphism',
style: TextStyle(color: Colors.black),
),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
_getChildren('1'),
_getChildren('2'),
_getChildren('3'),
_getChildren('+'),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
_getChildren('4'),
_getChildren('5'),
_getChildren('6'),
_getChildren('-'),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
_getChildren('7'),
_getChildren('8'),
_getChildren('9'),
_getChildren('*'),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
_getChildren('.'),
_getChildren('0'),
_getChildren('='),
_getChildren('/'),
],
),
],
)),
);
}
_getBoxDecoration() {
return BoxDecoration(
color: Colors.grey[300],
borderRadius: BorderRadius.circular(20),
boxShadow: [
BoxShadow(
color: Colors.grey.shade600,
offset: const Offset(5, 5),
blurRadius: 8,
),
const BoxShadow(
color: Colors.white,
offset: Offset(-5, -5),
blurRadius: 9,
),
],
);
}
Widget _getChildren(String icon) {
return Container(
height: 50,
width: 50,
decoration: _getBoxDecoration(),
child: Center(
child: Text(
icon,
style: const TextStyle(
fontSize: 30,
),
),
),
);
}
}