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

Side by Side Diff: sky/examples/widgets/sector.dart

Issue 1204523002: Material light and dark themes for Sky widgets (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix analyzer warning properly Created 5 years, 6 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:math' as math; 5 import 'dart:math' as math;
6 6
7 import 'package:sky/rendering/box.dart'; 7 import 'package:sky/rendering/box.dart';
8 import 'package:sky/rendering/flex.dart'; 8 import 'package:sky/rendering/flex.dart';
9 import 'package:sky/rendering/sky_binding.dart'; 9 import 'package:sky/rendering/sky_binding.dart';
10 import 'package:sky/theme/colors.dart' as colors; 10 import 'package:sky/theme/colors.dart' as colors;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 setState(() { 70 setState(() {
71 var ring = (sectors.child as RenderSectorRing); 71 var ring = (sectors.child as RenderSectorRing);
72 SectorDimensions currentSize = ring.getIntrinsicDimensions(const SectorCon straints(), ring.deltaRadius); 72 SectorDimensions currentSize = ring.getIntrinsicDimensions(const SectorCon straints(), ring.deltaRadius);
73 enabledAdd = currentSize.deltaTheta < kTwoPi; 73 enabledAdd = currentSize.deltaTheta < kTwoPi;
74 enabledRemove = ring.firstChild != null; 74 enabledRemove = ring.firstChild != null;
75 }); 75 });
76 } 76 }
77 77
78 Widget build() { 78 Widget build() {
79 return new Theme( 79 return new Theme(
80 data: new ThemeData(color: colors.Blue, text: typography.white), 80 data: new ThemeData.light(primary: colors.Blue, darkToolbar: true),
81 child: new Scaffold( 81 child: new Scaffold(
82 toolbar: new ToolBar( 82 toolbar: new ToolBar(
83 center: new Text('Sector Layout in a Widget Tree', style: typography .white.title)), 83 center: new Text('Sector Layout in a Widget Tree')),
84 body: new Material( 84 body: new Material(
85 edge: MaterialEdge.canvas, 85 edge: MaterialEdge.canvas,
86 child: new Flex([ 86 child: new Flex([
87 new Container( 87 new Container(
88 padding: new EdgeDims.symmetric(horizontal: 8.0, vertical: 25.0) , 88 padding: new EdgeDims.symmetric(horizontal: 8.0, vertical: 25.0) ,
89 child: new Flex([ 89 child: new Flex([
90 new RaisedButton( 90 new RaisedButton(
91 enabled: enabledAdd, 91 enabled: enabledAdd,
92 child: new ShrinkWrapWidth( 92 child: new ShrinkWrapWidth(
93 child: new Flex([ 93 child: new Flex([
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 139 }
140 } 140 }
141 141
142 void main() { 142 void main() {
143 runApp(new SectorApp()); 143 runApp(new SectorApp());
144 SkyBinding.instance.onFrame = () { 144 SkyBinding.instance.onFrame = () {
145 // uncomment this for debugging: 145 // uncomment this for debugging:
146 // SkyBinding.instance.debugDumpRenderTree(); 146 // SkyBinding.instance.debugDumpRenderTree();
147 }; 147 };
148 } 148 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698