OLD | NEW |
| (Empty) |
1 part of widgets; | |
2 | |
3 class FloatingActionButton extends MaterialComponent { | |
4 static final Style _style = new Style(''' | |
5 position: absolute; | |
6 bottom: 16px; | |
7 right: 16px; | |
8 z-index: 5; | |
9 transform: translateX(0); | |
10 width: 56px; | |
11 height: 56px; | |
12 background-color: ${Red[500]}; | |
13 color: white; | |
14 box-shadow: ${Shadow[3]}; | |
15 border-radius: 28px;''' | |
16 ); | |
17 static final Style _clipStyle = new Style(''' | |
18 transform: translateX(0); | |
19 position: absolute; | |
20 display: flex; | |
21 justify-content: center; | |
22 align-items: center; | |
23 top: 0; | |
24 left: 0; | |
25 right: 0; | |
26 bottom: 0; | |
27 -webkit-clip-path: circle(28px at center);'''); | |
28 | |
29 Node content; | |
30 | |
31 FloatingActionButton({ Object key, this.content }) : super(key: key); | |
32 | |
33 Node build() { | |
34 List<Node> children = [super.build()]; | |
35 | |
36 if (content != null) | |
37 children.add(content); | |
38 | |
39 return new Container( | |
40 key: "Container", | |
41 style: _style, | |
42 children: [ | |
43 new Container( | |
44 key: "Clip", | |
45 style: _clipStyle, | |
46 children: children | |
47 ) | |
48 ] | |
49 ); | |
50 } | |
51 } | |
OLD | NEW |