Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: sky/examples/fn/widgets/floating_action_button.dart

Issue 993033003: Move example fn widgets into sky/framework/components (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/examples/fn/widgets/fixedheightscrollable.dart ('k') | sky/examples/fn/widgets/icon.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « sky/examples/fn/widgets/fixedheightscrollable.dart ('k') | sky/examples/fn/widgets/icon.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698