Commit bb0d11be authored by Adam Barth's avatar Adam Barth

Merge pull request #2646 from abarth/rename_fixit

Execute rename fixit
parents 79d6bf6d 95fc5ae0
...@@ -16,7 +16,7 @@ class CardModel { ...@@ -16,7 +16,7 @@ class CardModel {
Key get key => new ObjectKey(this); Key get key => new ObjectKey(this);
} }
class CardCollection extends StatefulComponent { class CardCollection extends StatefulWidget {
CardCollectionState createState() => new CardCollectionState(); CardCollectionState createState() => new CardCollectionState();
} }
...@@ -279,7 +279,7 @@ class CardCollectionState extends State<CardCollection> { ...@@ -279,7 +279,7 @@ class CardCollectionState extends State<CardCollection> {
], ],
flexibleSpace: (_) { flexibleSpace: (_) {
return new Container( return new Container(
padding: const EdgeDims.only(left: 72.0), padding: const EdgeInsets.only(left: 72.0),
height: 128.0, height: 128.0,
child: new Align( child: new Align(
alignment: const FractionalOffset(0.0, 0.75), alignment: const FractionalOffset(0.0, 0.75),
...@@ -304,7 +304,7 @@ class CardCollectionState extends State<CardCollection> { ...@@ -304,7 +304,7 @@ class CardCollectionState extends State<CardCollection> {
color: _primaryColor[cardModel.color], color: _primaryColor[cardModel.color],
child: new Container( child: new Container(
height: cardModel.height, height: cardModel.height,
padding: const EdgeDims.all(kCardMargins), padding: const EdgeInsets.all(kCardMargins),
child: _editable ? child: _editable ?
new Center( new Center(
child: new Input( child: new Input(
...@@ -367,7 +367,7 @@ class CardCollectionState extends State<CardCollection> { ...@@ -367,7 +367,7 @@ class CardCollectionState extends State<CardCollection> {
bottom: 0.0, bottom: 0.0,
left: 0.0, left: 0.0,
child: new Container( child: new Container(
margin: const EdgeDims.all(4.0), margin: const EdgeInsets.all(4.0),
child: new Viewport( child: new Viewport(
child: new Container( child: new Container(
height: cardModel.height, height: cardModel.height,
...@@ -428,7 +428,7 @@ class CardCollectionState extends State<CardCollection> { ...@@ -428,7 +428,7 @@ class CardCollectionState extends State<CardCollection> {
} }
Widget body = new Container( Widget body = new Container(
padding: const EdgeDims.symmetric(vertical: 12.0, horizontal: 8.0), padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 8.0),
decoration: new BoxDecoration(backgroundColor: _primaryColor[50]), decoration: new BoxDecoration(backgroundColor: _primaryColor[50]),
child: cardCollection child: cardCollection
); );
......
...@@ -6,7 +6,7 @@ import 'dart:math' as math; ...@@ -6,7 +6,7 @@ import 'dart:math' as math;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ExampleDragTarget extends StatefulComponent { class ExampleDragTarget extends StatefulWidget {
ExampleDragTargetState createState() => new ExampleDragTargetState(); ExampleDragTargetState createState() => new ExampleDragTargetState();
} }
...@@ -25,7 +25,7 @@ class ExampleDragTargetState extends State<ExampleDragTarget> { ...@@ -25,7 +25,7 @@ class ExampleDragTargetState extends State<ExampleDragTarget> {
builder: (BuildContext context, List<Color> data, List<Color> rejectedData) { builder: (BuildContext context, List<Color> data, List<Color> rejectedData) {
return new Container( return new Container(
height: 100.0, height: 100.0,
margin: new EdgeDims.all(10.0), margin: new EdgeInsets.all(10.0),
decoration: new BoxDecoration( decoration: new BoxDecoration(
border: new Border.all( border: new Border.all(
width: 3.0, width: 3.0,
...@@ -39,7 +39,7 @@ class ExampleDragTargetState extends State<ExampleDragTarget> { ...@@ -39,7 +39,7 @@ class ExampleDragTargetState extends State<ExampleDragTarget> {
} }
} }
class Dot extends StatefulComponent { class Dot extends StatefulWidget {
Dot({ Key key, this.color, this.size, this.child, this.tappable: false }) : super(key: key); Dot({ Key key, this.color, this.size, this.child, this.tappable: false }) : super(key: key);
final Color color; final Color color;
final double size; final double size;
...@@ -66,7 +66,7 @@ class DotState extends State<Dot> { ...@@ -66,7 +66,7 @@ class DotState extends State<Dot> {
} }
} }
class ExampleDragSource extends StatelessComponent { class ExampleDragSource extends StatelessWidget {
ExampleDragSource({ ExampleDragSource({
Key key, Key key,
this.color, this.color,
...@@ -90,7 +90,7 @@ class ExampleDragSource extends StatelessComponent { ...@@ -90,7 +90,7 @@ class ExampleDragSource extends StatelessComponent {
size *= kHeavyMultiplier; size *= kHeavyMultiplier;
Widget contents = new DefaultTextStyle( Widget contents = new DefaultTextStyle(
style: Theme.of(context).text.body1.copyWith(textAlign: TextAlign.center), style: Theme.of(context).textTheme.body1.copyWith(textAlign: TextAlign.center),
child: new Dot( child: new Dot(
color: color, color: color,
size: size, size: size,
...@@ -162,7 +162,7 @@ class DashOutlineCirclePainter extends CustomPainter { ...@@ -162,7 +162,7 @@ class DashOutlineCirclePainter extends CustomPainter {
bool shouldRepaint(DashOutlineCirclePainter oldPainter) => false; bool shouldRepaint(DashOutlineCirclePainter oldPainter) => false;
} }
class MovableBall extends StatelessComponent { class MovableBall extends StatelessWidget {
MovableBall(this.position, this.ballPosition, this.callback); MovableBall(this.position, this.ballPosition, this.callback);
final int position; final int position;
...@@ -174,7 +174,7 @@ class MovableBall extends StatelessComponent { ...@@ -174,7 +174,7 @@ class MovableBall extends StatelessComponent {
Widget build(BuildContext context) { Widget build(BuildContext context) {
Widget ball = new DefaultTextStyle( Widget ball = new DefaultTextStyle(
style: Theme.of(context).text.body1.copyWith( style: Theme.of(context).textTheme.body1.copyWith(
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white color: Colors.white
), ),
...@@ -212,7 +212,7 @@ class MovableBall extends StatelessComponent { ...@@ -212,7 +212,7 @@ class MovableBall extends StatelessComponent {
} }
} }
class DragAndDropApp extends StatefulComponent { class DragAndDropApp extends StatefulWidget {
DragAndDropAppState createState() => new DragAndDropAppState(); DragAndDropAppState createState() => new DragAndDropAppState();
} }
......
...@@ -32,7 +32,7 @@ enum WindowSide { ...@@ -32,7 +32,7 @@ enum WindowSide {
bottomRight, bottomRight,
} }
class WindowDecoration extends StatelessComponent { class WindowDecoration extends StatelessWidget {
WindowDecoration({ WindowDecoration({
Key key, Key key,
this.side, this.side,
...@@ -87,7 +87,7 @@ class WindowDecoration extends StatelessComponent { ...@@ -87,7 +87,7 @@ class WindowDecoration extends StatelessComponent {
} }
} }
class Window extends StatefulComponent { class Window extends StatefulWidget {
Window({ Key key, this.child, this.onClose }) : super(key: key); Window({ Key key, this.child, this.onClose }) : super(key: key);
final ChildViewConnection child; final ChildViewConnection child;
...@@ -143,7 +143,7 @@ class _WindowState extends State<Window> { ...@@ -143,7 +143,7 @@ class _WindowState extends State<Window> {
color: Colors.blue[200] color: Colors.blue[200]
), ),
new Container( new Container(
padding: const EdgeDims.all(_kWindowPadding), padding: const EdgeInsets.all(_kWindowPadding),
child: new Material( child: new Material(
elevation: 8, elevation: 8,
child: new ChildView(child: config.child) child: new ChildView(child: config.child)
...@@ -155,7 +155,7 @@ class _WindowState extends State<Window> { ...@@ -155,7 +155,7 @@ class _WindowState extends State<Window> {
} }
} }
class LauncherItem extends StatelessComponent { class LauncherItem extends StatelessWidget {
LauncherItem({ LauncherItem({
Key key, Key key,
this.url, this.url,
...@@ -175,7 +175,7 @@ class LauncherItem extends StatelessComponent { ...@@ -175,7 +175,7 @@ class LauncherItem extends StatelessComponent {
} }
} }
class Launcher extends StatelessComponent { class Launcher extends StatelessWidget {
Launcher({ Key key, this.items }) : super(key: key); Launcher({ Key key, this.items }) : super(key: key);
final List<Widget> items; final List<Widget> items;
...@@ -188,7 +188,7 @@ class Launcher extends StatelessComponent { ...@@ -188,7 +188,7 @@ class Launcher extends StatelessComponent {
} }
} }
class WindowManager extends StatefulComponent { class WindowManager extends StatefulWidget {
_WindowManagerState createState() => new _WindowManagerState(); _WindowManagerState createState() => new _WindowManagerState();
} }
......
...@@ -52,7 +52,7 @@ class _MarkerPainter extends CustomPainter { ...@@ -52,7 +52,7 @@ class _MarkerPainter extends CustomPainter {
} }
} }
class Marker extends StatelessComponent { class Marker extends StatelessWidget {
Marker({ Marker({
this.type: MarkerType.touch, this.type: MarkerType.touch,
this.position, this.position,
...@@ -82,7 +82,7 @@ class Marker extends StatelessComponent { ...@@ -82,7 +82,7 @@ class Marker extends StatelessComponent {
} }
} }
class OverlayGeometryApp extends StatefulComponent { class OverlayGeometryApp extends StatefulWidget {
OverlayGeometryAppState createState() => new OverlayGeometryAppState(); OverlayGeometryAppState createState() => new OverlayGeometryAppState();
} }
...@@ -144,7 +144,7 @@ class OverlayGeometryAppState extends State<OverlayGeometryApp> { ...@@ -144,7 +144,7 @@ class OverlayGeometryAppState extends State<OverlayGeometryApp> {
color: cardModel.color, color: cardModel.color,
child: new Container( child: new Container(
height: cardModel.height, height: cardModel.height,
padding: const EdgeDims.all(8.0), padding: const EdgeInsets.all(8.0),
child: new Center(child: new Text(cardModel.label, style: cardLabelStyle)) child: new Center(child: new Text(cardModel.label, style: cardLabelStyle))
) )
) )
...@@ -156,7 +156,7 @@ class OverlayGeometryAppState extends State<OverlayGeometryApp> { ...@@ -156,7 +156,7 @@ class OverlayGeometryAppState extends State<OverlayGeometryApp> {
new Scaffold( new Scaffold(
toolBar: new ToolBar(center: new Text('Tap a Card')), toolBar: new ToolBar(center: new Text('Tap a Card')),
body: new Container( body: new Container(
padding: const EdgeDims.symmetric(vertical: 12.0, horizontal: 8.0), padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 8.0),
child: new ScrollableMixedWidgetList( child: new ScrollableMixedWidgetList(
builder: builder, builder: builder,
token: cardModels.length, token: cardModels.length,
......
...@@ -13,7 +13,7 @@ class CardModel { ...@@ -13,7 +13,7 @@ class CardModel {
Key get key => new ObjectKey(this); Key get key => new ObjectKey(this);
} }
class PageableListApp extends StatefulComponent { class PageableListApp extends StatefulWidget {
PageableListAppState createState() => new PageableListAppState(); PageableListAppState createState() => new PageableListAppState();
} }
...@@ -46,7 +46,7 @@ class PageableListAppState extends State<PageableListApp> { ...@@ -46,7 +46,7 @@ class PageableListAppState extends State<PageableListApp> {
child: new Container( child: new Container(
width: cardModel.size.width, width: cardModel.size.width,
height: cardModel.size.height, height: cardModel.size.height,
padding: const EdgeDims.all(8.0), padding: const EdgeInsets.all(8.0),
child: new Center(child: new Text(cardModel.label, style: cardLabelStyle)) child: new Center(child: new Text(cardModel.label, style: cardLabelStyle))
) )
); );
......
...@@ -30,7 +30,7 @@ void main() { ...@@ -30,7 +30,7 @@ void main() {
); );
} }
class RawKeyboardDemo extends StatefulComponent { class RawKeyboardDemo extends StatefulWidget {
RawKeyboardDemo({ GlobalKey key }) : super(key: key); RawKeyboardDemo({ GlobalKey key }) : super(key: key);
_HardwareKeyDemoState createState() => new _HardwareKeyDemoState(); _HardwareKeyDemoState createState() => new _HardwareKeyDemoState();
......
...@@ -15,7 +15,7 @@ void main() { ...@@ -15,7 +15,7 @@ void main() {
void addAlignmentRow(FlexAlignItems alignItems) { void addAlignmentRow(FlexAlignItems alignItems) {
TextStyle style = const TextStyle(color: const Color(0xFF000000)); TextStyle style = const TextStyle(color: const Color(0xFF000000));
RenderParagraph paragraph = new RenderParagraph(new TextSpan(style: style, text: '$alignItems')); RenderParagraph paragraph = new RenderParagraph(new TextSpan(style: style, text: '$alignItems'));
table.add(new RenderPadding(child: paragraph, padding: new EdgeDims.only(top: 20.0))); table.add(new RenderPadding(child: paragraph, padding: new EdgeInsets.only(top: 20.0)));
RenderFlex row = new RenderFlex(alignItems: alignItems, textBaseline: TextBaseline.alphabetic); RenderFlex row = new RenderFlex(alignItems: alignItems, textBaseline: TextBaseline.alphabetic);
style = new TextStyle(fontSize: 15.0, color: const Color(0xFF000000)); style = new TextStyle(fontSize: 15.0, color: const Color(0xFF000000));
row.add(new RenderDecoratedBox( row.add(new RenderDecoratedBox(
...@@ -49,7 +49,7 @@ void main() { ...@@ -49,7 +49,7 @@ void main() {
void addJustificationRow(FlexJustifyContent justify) { void addJustificationRow(FlexJustifyContent justify) {
const TextStyle style = const TextStyle(color: const Color(0xFF000000)); const TextStyle style = const TextStyle(color: const Color(0xFF000000));
RenderParagraph paragraph = new RenderParagraph(new TextSpan(style: style, text: '$justify')); RenderParagraph paragraph = new RenderParagraph(new TextSpan(style: style, text: '$justify'));
table.add(new RenderPadding(child: paragraph, padding: new EdgeDims.only(top: 20.0))); table.add(new RenderPadding(child: paragraph, padding: new EdgeInsets.only(top: 20.0)));
RenderFlex row = new RenderFlex(direction: FlexDirection.horizontal); RenderFlex row = new RenderFlex(direction: FlexDirection.horizontal);
row.add(new RenderSolidColorBox(const Color(0xFFFFCCCC), desiredSize: new Size(80.0, 60.0))); row.add(new RenderSolidColorBox(const Color(0xFFFFCCCC), desiredSize: new Size(80.0, 60.0)));
row.add(new RenderSolidColorBox(const Color(0xFFCCFFCC), desiredSize: new Size(64.0, 60.0))); row.add(new RenderSolidColorBox(const Color(0xFFCCFFCC), desiredSize: new Size(64.0, 60.0)));
...@@ -68,7 +68,7 @@ void main() { ...@@ -68,7 +68,7 @@ void main() {
RenderDecoratedBox root = new RenderDecoratedBox( RenderDecoratedBox root = new RenderDecoratedBox(
decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFFFF)), decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFFFF)),
child: new RenderPadding(child: table, padding: new EdgeDims.symmetric(vertical: 50.0)) child: new RenderPadding(child: table, padding: new EdgeInsets.symmetric(vertical: 50.0))
); );
new RenderingFlutterBinding(root: root); new RenderingFlutterBinding(root: root);
......
...@@ -51,7 +51,7 @@ class PianoKey { ...@@ -51,7 +51,7 @@ class PianoKey {
} }
} }
class PianoApp extends StatelessComponent { class PianoApp extends StatelessWidget {
final List<PianoKey> keys = <PianoKey>[ final List<PianoKey> keys = <PianoKey>[
new PianoKey(Colors.red[500], chimes), new PianoKey(Colors.red[500], chimes),
new PianoKey(Colors.orange[500], chainsaw), new PianoKey(Colors.orange[500], chainsaw),
...@@ -105,8 +105,8 @@ Widget statusBox(Widget child) { ...@@ -105,8 +105,8 @@ Widget statusBox(Widget child) {
backgroundColor: darkGray backgroundColor: darkGray
), ),
height: 90.0, height: 90.0,
padding: const EdgeDims.all(8.0), padding: const EdgeInsets.all(8.0),
margin: const EdgeDims.symmetric(horizontal: 50.0), margin: const EdgeInsets.symmetric(horizontal: 50.0),
child: new Center(child: child) child: new Center(child: child)
) )
); );
......
...@@ -46,7 +46,7 @@ class _MyAutoLayoutDelegate extends AutoLayoutDelegate { ...@@ -46,7 +46,7 @@ class _MyAutoLayoutDelegate extends AutoLayoutDelegate {
bool shouldUpdateConstraints(_MyAutoLayoutDelegate oldDelegate) => true; bool shouldUpdateConstraints(_MyAutoLayoutDelegate oldDelegate) => true;
} }
class ColoredBoxes extends StatefulComponent { class ColoredBoxes extends StatefulWidget {
_ColoredBoxesState createState() => new _ColoredBoxesState(); _ColoredBoxesState createState() => new _ColoredBoxesState();
} }
......
...@@ -35,7 +35,7 @@ class RenderDots extends RenderConstrainedBox { ...@@ -35,7 +35,7 @@ class RenderDots extends RenderConstrainedBox {
} }
} }
class Dots extends OneChildRenderObjectWidget { class Dots extends SingleChildRenderObjectWidget {
Dots({ Key key, Widget child }) : super(key: key, child: child); Dots({ Key key, Widget child }) : super(key: key, child: child);
RenderDots createRenderObject(BuildContext context) => new RenderDots(); RenderDots createRenderObject(BuildContext context) => new RenderDots();
} }
......
...@@ -54,7 +54,7 @@ class _GesturePainter extends CustomPainter { ...@@ -54,7 +54,7 @@ class _GesturePainter extends CustomPainter {
} }
} }
class GestureDemo extends StatefulComponent { class GestureDemo extends StatefulWidget {
_GestureDemoState createState() => new _GestureDemoState(); _GestureDemoState createState() => new _GestureDemoState();
} }
...@@ -161,7 +161,7 @@ class _GestureDemoState extends State<GestureDemo> { ...@@ -161,7 +161,7 @@ class _GestureDemoState extends State<GestureDemo> {
left: 0.0, left: 0.0,
child: new Card( child: new Card(
child: new Container( child: new Container(
padding: new EdgeDims.all(4.0), padding: new EdgeInsets.all(4.0),
child: new Column( child: new Column(
children: <Widget>[ children: <Widget>[
new Row( new Row(
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class AdaptedListItem extends StatelessComponent { class AdaptedListItem extends StatelessWidget {
AdaptedListItem({ Key key, this.name }) : super(key: key); AdaptedListItem({ Key key, this.name }) : super(key: key);
final String name; final String name;
...@@ -15,7 +15,7 @@ class AdaptedListItem extends StatelessComponent { ...@@ -15,7 +15,7 @@ class AdaptedListItem extends StatelessComponent {
new Container( new Container(
width: 32.0, width: 32.0,
height: 32.0, height: 32.0,
margin: const EdgeDims.all(8.0), margin: const EdgeInsets.all(8.0),
decoration: new BoxDecoration( decoration: new BoxDecoration(
backgroundColor: Colors.lightBlueAccent[100] backgroundColor: Colors.lightBlueAccent[100]
) )
...@@ -26,7 +26,7 @@ class AdaptedListItem extends StatelessComponent { ...@@ -26,7 +26,7 @@ class AdaptedListItem extends StatelessComponent {
} }
} }
class AdaptedGridItem extends StatelessComponent { class AdaptedGridItem extends StatelessWidget {
AdaptedGridItem({ Key key, this.name }) : super(key: key); AdaptedGridItem({ Key key, this.name }) : super(key: key);
final String name; final String name;
...@@ -43,7 +43,7 @@ class AdaptedGridItem extends StatelessComponent { ...@@ -43,7 +43,7 @@ class AdaptedGridItem extends StatelessComponent {
) )
), ),
new Container( new Container(
margin: const EdgeDims.only(left: 8.0), margin: const EdgeInsets.only(left: 8.0),
child: new Row( child: new Row(
children: <Widget>[ children: <Widget>[
new Flexible( new Flexible(
...@@ -65,7 +65,7 @@ const double _kListItemExtent = 50.0; ...@@ -65,7 +65,7 @@ const double _kListItemExtent = 50.0;
const double _kMaxTileWidth = 150.0; const double _kMaxTileWidth = 150.0;
const double _kGridViewBreakpoint = 450.0; const double _kGridViewBreakpoint = 450.0;
class AdaptiveContainer extends StatelessComponent { class AdaptiveContainer extends StatelessWidget {
AdaptiveContainer({ Key key, this.names }) : super(key: key); AdaptiveContainer({ Key key, this.names }) : super(key: key);
final List<String> names; final List<String> names;
......
...@@ -16,7 +16,7 @@ RenderBox initCircle() { ...@@ -16,7 +16,7 @@ RenderBox initCircle() {
); );
} }
class SectorApp extends StatefulComponent { class SectorApp extends StatefulWidget {
SectorAppState createState() => new SectorAppState(); SectorAppState createState() => new SectorAppState();
} }
...@@ -92,7 +92,7 @@ class SectorAppState extends State<SectorApp> { ...@@ -92,7 +92,7 @@ class SectorAppState extends State<SectorApp> {
return new Column( return new Column(
children: <Widget>[ children: <Widget>[
new Container( new Container(
padding: new EdgeDims.symmetric(horizontal: 8.0, vertical: 25.0), padding: new EdgeInsets.symmetric(horizontal: 8.0, vertical: 25.0),
child: new Row( child: new Row(
children: <Widget>[ children: <Widget>[
new RaisedButton( new RaisedButton(
...@@ -101,8 +101,8 @@ class SectorAppState extends State<SectorApp> { ...@@ -101,8 +101,8 @@ class SectorAppState extends State<SectorApp> {
child: new Row( child: new Row(
children: <Widget>[ children: <Widget>[
new Container( new Container(
padding: new EdgeDims.all(4.0), padding: new EdgeInsets.all(4.0),
margin: new EdgeDims.only(right: 10.0), margin: new EdgeInsets.only(right: 10.0),
child: new WidgetToRenderBoxAdapter(renderBox: sectorAddIcon) child: new WidgetToRenderBoxAdapter(renderBox: sectorAddIcon)
), ),
new Text('ADD SECTOR'), new Text('ADD SECTOR'),
...@@ -116,8 +116,8 @@ class SectorAppState extends State<SectorApp> { ...@@ -116,8 +116,8 @@ class SectorAppState extends State<SectorApp> {
child: new Row( child: new Row(
children: <Widget>[ children: <Widget>[
new Container( new Container(
padding: new EdgeDims.all(4.0), padding: new EdgeInsets.all(4.0),
margin: new EdgeDims.only(right: 10.0), margin: new EdgeInsets.only(right: 10.0),
child: new WidgetToRenderBoxAdapter(renderBox: sectorRemoveIcon) child: new WidgetToRenderBoxAdapter(renderBox: sectorRemoveIcon)
), ),
new Text('REMOVE SECTOR'), new Text('REMOVE SECTOR'),
...@@ -131,11 +131,11 @@ class SectorAppState extends State<SectorApp> { ...@@ -131,11 +131,11 @@ class SectorAppState extends State<SectorApp> {
), ),
new Flexible( new Flexible(
child: new Container( child: new Container(
margin: new EdgeDims.all(8.0), margin: new EdgeInsets.all(8.0),
decoration: new BoxDecoration( decoration: new BoxDecoration(
border: new Border.all(color: new Color(0xFF000000)) border: new Border.all(color: new Color(0xFF000000))
), ),
padding: new EdgeDims.all(8.0), padding: new EdgeInsets.all(8.0),
child: new WidgetToRenderBoxAdapter( child: new WidgetToRenderBoxAdapter(
renderBox: sectors, renderBox: sectors,
onBuild: doUpdates onBuild: doUpdates
......
...@@ -16,7 +16,7 @@ void addFlexChildSolidColor(RenderFlex parent, Color backgroundColor, { int flex ...@@ -16,7 +16,7 @@ void addFlexChildSolidColor(RenderFlex parent, Color backgroundColor, { int flex
} }
// Solid colour, Widget version // Solid colour, Widget version
class Rectangle extends StatelessComponent { class Rectangle extends StatelessWidget {
Rectangle(this.color, { Key key }) : super(key: key); Rectangle(this.color, { Key key }) : super(key: key);
final Color color; final Color color;
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -40,8 +40,8 @@ void attachWidgetTreeToRenderTree(RenderProxyBox container) { ...@@ -40,8 +40,8 @@ void attachWidgetTreeToRenderTree(RenderProxyBox container) {
new Rectangle(const Color(0xFF00FFFF)), new Rectangle(const Color(0xFF00FFFF)),
new Material( new Material(
child: new Container( child: new Container(
padding: new EdgeDims.all(10.0), padding: new EdgeInsets.all(10.0),
margin: new EdgeDims.all(10.0), margin: new EdgeInsets.all(10.0),
child: new Row( child: new Row(
children: <Widget>[ children: <Widget>[
new RaisedButton( new RaisedButton(
...@@ -95,7 +95,7 @@ void main() { ...@@ -95,7 +95,7 @@ void main() {
addFlexChildSolidColor(flexRoot, const Color(0xFF0000FF), flex: 1); addFlexChildSolidColor(flexRoot, const Color(0xFF0000FF), flex: 1);
transformBox = new RenderTransform(child: flexRoot, transform: new Matrix4.identity()); transformBox = new RenderTransform(child: flexRoot, transform: new Matrix4.identity());
RenderPadding root = new RenderPadding(padding: new EdgeDims.all(80.0), child: transformBox); RenderPadding root = new RenderPadding(padding: new EdgeInsets.all(80.0), child: transformBox);
WidgetFlutterBinding.instance.renderView.child = root; WidgetFlutterBinding.instance.renderView.child = root;
WidgetFlutterBinding.instance.addPersistentFrameCallback(rotate); WidgetFlutterBinding.instance.addPersistentFrameCallback(rotate);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
class SpinningSquare extends StatefulComponent { class SpinningSquare extends StatefulWidget {
_SpinningSquareState createState() => new _SpinningSquareState(); _SpinningSquareState createState() => new _SpinningSquareState();
} }
......
...@@ -57,11 +57,11 @@ Widget toStyledText(String name, String text) { ...@@ -57,11 +57,11 @@ Widget toStyledText(String name, String text) {
Widget toPlainText(String name, String text) => new Text(name + ":" + text); Widget toPlainText(String name, String text) => new Text(name + ":" + text);
class SpeakerSeparator extends StatelessComponent { class SpeakerSeparator extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Container( return new Container(
constraints: const BoxConstraints.expand(height: 0.0), constraints: const BoxConstraints.expand(height: 0.0),
margin: const EdgeDims.symmetric(vertical: 10.0, horizontal: 64.0), margin: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 64.0),
decoration: const BoxDecoration( decoration: const BoxDecoration(
border: const Border( border: const Border(
bottom: const BorderSide(color: const Color.fromARGB(24, 0, 0, 0)) bottom: const BorderSide(color: const Color.fromARGB(24, 0, 0, 0))
...@@ -71,7 +71,7 @@ class SpeakerSeparator extends StatelessComponent { ...@@ -71,7 +71,7 @@ class SpeakerSeparator extends StatelessComponent {
} }
} }
class StyledTextDemo extends StatefulComponent { class StyledTextDemo extends StatefulWidget {
_StyledTextDemoState createState() => new _StyledTextDemoState(); _StyledTextDemoState createState() => new _StyledTextDemoState();
} }
...@@ -104,7 +104,7 @@ class _StyledTextDemoState extends State<StyledTextDemo> { ...@@ -104,7 +104,7 @@ class _StyledTextDemoState extends State<StyledTextDemo> {
return new GestureDetector( return new GestureDetector(
onTap: _handleTap, onTap: _handleTap,
child: new Container( child: new Container(
padding: new EdgeDims.symmetric(horizontal: 8.0), padding: new EdgeInsets.symmetric(horizontal: 8.0),
child: new Column( child: new Column(
children: children, children: children,
justifyContent: FlexJustifyContent.center, justifyContent: FlexJustifyContent.center,
......
...@@ -55,7 +55,7 @@ class _ButtonDemo { ...@@ -55,7 +55,7 @@ class _ButtonDemo {
int get hashCode => hashValues(title.hashCode, text.hashCode); int get hashCode => hashValues(title.hashCode, text.hashCode);
} }
class ButtonsDemo extends StatefulComponent { class ButtonsDemo extends StatefulWidget {
_ButtonsDemoState createState() => new _ButtonsDemoState(); _ButtonsDemoState createState() => new _ButtonsDemoState();
} }
...@@ -91,7 +91,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> { ...@@ -91,7 +91,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
Widget buildRaisedButton(BuildContext context) { Widget buildRaisedButton(BuildContext context) {
return new Container( return new Container(
margin: const EdgeDims.symmetric(vertical: 16.0), margin: const EdgeInsets.symmetric(vertical: 16.0),
child: new Column( child: new Column(
children: <Widget>[ children: <Widget>[
new RaisedButton( new RaisedButton(
...@@ -108,7 +108,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> { ...@@ -108,7 +108,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
] ]
.map((Widget child) { .map((Widget child) {
return new Container( return new Container(
margin: const EdgeDims.symmetric(vertical: 8.0), margin: const EdgeInsets.symmetric(vertical: 8.0),
child: child child: child
); );
}) })
...@@ -119,7 +119,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> { ...@@ -119,7 +119,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
Widget buildFlatButton(BuildContext context) { Widget buildFlatButton(BuildContext context) {
return new Container( return new Container(
margin: const EdgeDims.symmetric(vertical: 16.0), margin: const EdgeInsets.symmetric(vertical: 16.0),
child: new ButtonTheme( child: new ButtonTheme(
color: ButtonColor.accent, color: ButtonColor.accent,
child: new Column( child: new Column(
...@@ -138,7 +138,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> { ...@@ -138,7 +138,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
] ]
.map((Widget child) { .map((Widget child) {
return new Container( return new Container(
margin: const EdgeDims.symmetric(vertical: 8.0), margin: const EdgeInsets.symmetric(vertical: 8.0),
child: child child: child
); );
}) })
...@@ -177,13 +177,13 @@ class _ButtonsDemoState extends State<ButtonsDemo> { ...@@ -177,13 +177,13 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
Widget buildTabView(_ButtonDemo demo) { Widget buildTabView(_ButtonDemo demo) {
return new Builder( return new Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
final TextStyle textStyle = Theme.of(context).text.caption.copyWith(fontSize: 16.0); final TextStyle textStyle = Theme.of(context).textTheme.caption.copyWith(fontSize: 16.0);
return new Column( return new Column(
alignItems: FlexAlignItems.stretch, alignItems: FlexAlignItems.stretch,
children: <Widget>[ children: <Widget>[
demo.builder(context), demo.builder(context),
new Padding( new Padding(
padding: const EdgeDims.symmetric(horizontal: 32.0), padding: const EdgeInsets.symmetric(horizontal: 32.0),
child: new Text(demo.text, style: textStyle) child: new Text(demo.text, style: textStyle)
) )
] ]
......
...@@ -36,7 +36,7 @@ final List<TravelDestination> destinations = <TravelDestination>[ ...@@ -36,7 +36,7 @@ final List<TravelDestination> destinations = <TravelDestination>[
) )
]; ];
class TravelDestinationItem extends StatelessComponent { class TravelDestinationItem extends StatelessWidget {
TravelDestinationItem({ Key key, this.destination }) : super(key: key) { TravelDestinationItem({ Key key, this.destination }) : super(key: key) {
assert(destination != null && destination.isValid); assert(destination != null && destination.isValid);
} }
...@@ -45,9 +45,9 @@ class TravelDestinationItem extends StatelessComponent { ...@@ -45,9 +45,9 @@ class TravelDestinationItem extends StatelessComponent {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ThemeData theme = Theme.of(context); ThemeData theme = Theme.of(context);
TextStyle titleStyle = theme.text.headline.copyWith(color: Colors.white); TextStyle titleStyle = theme.textTheme.headline.copyWith(color: Colors.white);
TextStyle descriptionStyle = theme.text.subhead; TextStyle descriptionStyle = theme.textTheme.subhead;
TextStyle buttonStyle = theme.text.button.copyWith(color: theme.primaryColor); TextStyle buttonStyle = theme.textTheme.button.copyWith(color: theme.primaryColor);
return new Card( return new Card(
child: new SizedBox( child: new SizedBox(
...@@ -80,7 +80,7 @@ class TravelDestinationItem extends StatelessComponent { ...@@ -80,7 +80,7 @@ class TravelDestinationItem extends StatelessComponent {
// description and share/expore buttons // description and share/expore buttons
new Flexible( new Flexible(
child: new Padding( child: new Padding(
padding: const EdgeDims.all(16.0), padding: const EdgeInsets.all(16.0),
child: new Column( child: new Column(
justifyContent: FlexJustifyContent.start, justifyContent: FlexJustifyContent.start,
alignItems: FlexAlignItems.start, alignItems: FlexAlignItems.start,
...@@ -96,7 +96,7 @@ class TravelDestinationItem extends StatelessComponent { ...@@ -96,7 +96,7 @@ class TravelDestinationItem extends StatelessComponent {
alignItems: FlexAlignItems.end, alignItems: FlexAlignItems.end,
children: <Widget>[ children: <Widget>[
new Padding( new Padding(
padding: const EdgeDims.only(right: 16.0), padding: const EdgeInsets.only(right: 16.0),
child: new Text('SHARE', style: buttonStyle) child: new Text('SHARE', style: buttonStyle)
), ),
new Text('EXPLORE', style: buttonStyle) new Text('EXPLORE', style: buttonStyle)
...@@ -114,17 +114,17 @@ class TravelDestinationItem extends StatelessComponent { ...@@ -114,17 +114,17 @@ class TravelDestinationItem extends StatelessComponent {
} }
} }
class CardsDemo extends StatelessComponent { class CardsDemo extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Scaffold( return new Scaffold(
toolBar: new ToolBar( toolBar: new ToolBar(
center: new Text("Travel Stream") center: new Text("Travel Stream")
), ),
body: new Block( body: new Block(
padding: const EdgeDims.only(top: 8.0, left: 8.0, right: 8.0), padding: const EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0),
children: destinations.map((TravelDestination destination) { children: destinations.map((TravelDestination destination) {
return new Container( return new Container(
margin: const EdgeDims.only(bottom: 8.0), margin: const EdgeInsets.only(bottom: 8.0),
child: new TravelDestinationItem(destination: destination) child: new TravelDestinationItem(destination: destination)
); );
}) })
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ChipDemo extends StatefulComponent { class ChipDemo extends StatefulWidget {
_ChipDemoState createState() => new _ChipDemoState(); _ChipDemoState createState() => new _ChipDemoState();
} }
......
...@@ -41,7 +41,7 @@ const List<ColorSwatch> colorSwatches = const <ColorSwatch>[ ...@@ -41,7 +41,7 @@ const List<ColorSwatch> colorSwatches = const <ColorSwatch>[
]; ];
class ColorItem extends StatelessComponent { class ColorItem extends StatelessWidget {
ColorItem({ Key key, this.index, this.color, this.prefix: '' }) : super(key: key) { ColorItem({ Key key, this.index, this.color, this.prefix: '' }) : super(key: key) {
assert(index != null); assert(index != null);
assert(color != null); assert(color != null);
...@@ -57,7 +57,7 @@ class ColorItem extends StatelessComponent { ...@@ -57,7 +57,7 @@ class ColorItem extends StatelessComponent {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Container( return new Container(
height: kColorItemHeight, height: kColorItemHeight,
padding: const EdgeDims.symmetric(horizontal: 16.0), padding: const EdgeInsets.symmetric(horizontal: 16.0),
decoration: new BoxDecoration(backgroundColor: color), decoration: new BoxDecoration(backgroundColor: color),
child: new Row( child: new Row(
justifyContent: FlexJustifyContent.spaceBetween, justifyContent: FlexJustifyContent.spaceBetween,
...@@ -71,7 +71,7 @@ class ColorItem extends StatelessComponent { ...@@ -71,7 +71,7 @@ class ColorItem extends StatelessComponent {
} }
} }
class ColorSwatchTabView extends StatelessComponent { class ColorSwatchTabView extends StatelessWidget {
ColorSwatchTabView({ Key key, this.swatch }) : super(key: key) { ColorSwatchTabView({ Key key, this.swatch }) : super(key: key) {
assert(swatch != null && swatch.isValid); assert(swatch != null && swatch.isValid);
} }
...@@ -106,7 +106,7 @@ class ColorSwatchTabView extends StatelessComponent { ...@@ -106,7 +106,7 @@ class ColorSwatchTabView extends StatelessComponent {
} }
} }
class ColorsDemo extends StatelessComponent { class ColorsDemo extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new TabBarSelection<ColorSwatch>( return new TabBarSelection<ColorSwatch>(
values: colorSwatches, values: colorSwatches,
......
...@@ -7,7 +7,7 @@ import 'dart:async'; ...@@ -7,7 +7,7 @@ import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
class DatePickerDemo extends StatefulComponent { class DatePickerDemo extends StatefulWidget {
_DatePickerDemoState createState() => new _DatePickerDemoState(); _DatePickerDemoState createState() => new _DatePickerDemoState();
} }
......
...@@ -20,7 +20,7 @@ const String _alertWithTitleText = ...@@ -20,7 +20,7 @@ const String _alertWithTitleText =
"Let Google help apps determine location. This means sending anyonmous location " "Let Google help apps determine location. This means sending anyonmous location "
"data to Google, even when no apps are running."; "data to Google, even when no apps are running.";
class DialogDemoItem extends StatelessComponent { class DialogDemoItem extends StatelessWidget {
DialogDemoItem({ Key key, this.icon, this.color, this.text, this.onPressed }) : super(key: key); DialogDemoItem({ Key key, this.icon, this.color, this.text, this.onPressed }) : super(key: key);
final IconData icon; final IconData icon;
...@@ -32,7 +32,7 @@ class DialogDemoItem extends StatelessComponent { ...@@ -32,7 +32,7 @@ class DialogDemoItem extends StatelessComponent {
return new InkWell( return new InkWell(
onTap: onPressed, onTap: onPressed,
child: new Padding( child: new Padding(
padding: const EdgeDims.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 8.0),
child: new Row( child: new Row(
justifyContent: FlexJustifyContent.start, justifyContent: FlexJustifyContent.start,
alignItems: FlexAlignItems.center, alignItems: FlexAlignItems.center,
...@@ -43,7 +43,7 @@ class DialogDemoItem extends StatelessComponent { ...@@ -43,7 +43,7 @@ class DialogDemoItem extends StatelessComponent {
color: color color: color
), ),
new Padding( new Padding(
padding: const EdgeDims.only(left: 16.0), padding: const EdgeInsets.only(left: 16.0),
child: new Text(text) child: new Text(text)
) )
] ]
...@@ -53,7 +53,7 @@ class DialogDemoItem extends StatelessComponent { ...@@ -53,7 +53,7 @@ class DialogDemoItem extends StatelessComponent {
} }
} }
class DialogDemo extends StatefulComponent { class DialogDemo extends StatefulWidget {
DialogDemoState createState() => new DialogDemoState(); DialogDemoState createState() => new DialogDemoState();
} }
...@@ -76,7 +76,7 @@ class DialogDemoState extends State<DialogDemo> { ...@@ -76,7 +76,7 @@ class DialogDemoState extends State<DialogDemo> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final TextStyle dialogTextStyle = theme.text.subhead.copyWith(color: theme.text.caption.color); final TextStyle dialogTextStyle = theme.textTheme.subhead.copyWith(color: theme.textTheme.caption.color);
return new Scaffold( return new Scaffold(
key: scaffoldKey, key: scaffoldKey,
...@@ -84,7 +84,7 @@ class DialogDemoState extends State<DialogDemo> { ...@@ -84,7 +84,7 @@ class DialogDemoState extends State<DialogDemo> {
center: new Text('Dialogs') center: new Text('Dialogs')
), ),
body: new Block( body: new Block(
padding: const EdgeDims.symmetric(vertical: 24.0, horizontal: 72.0), padding: const EdgeInsets.symmetric(vertical: 24.0, horizontal: 72.0),
children: <Widget>[ children: <Widget>[
new RaisedButton( new RaisedButton(
child: new Text('ALERT'), child: new Text('ALERT'),
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class DropDownDemo extends StatefulComponent { class DropDownDemo extends StatefulWidget {
_DropDownDemoState createState() => new _DropDownDemoState(); _DropDownDemoState createState() => new _DropDownDemoState();
} }
......
...@@ -13,7 +13,7 @@ import 'package:vector_math/vector_math_64.dart' as vec; ...@@ -13,7 +13,7 @@ import 'package:vector_math/vector_math_64.dart' as vec;
ImageMap _images; ImageMap _images;
SpriteSheet _sprites; SpriteSheet _sprites;
class FitnessDemo extends StatelessComponent { class FitnessDemo extends StatelessWidget {
FitnessDemo({ Key key }) : super(key: key); FitnessDemo({ Key key }) : super(key: key);
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -26,7 +26,7 @@ class FitnessDemo extends StatelessComponent { ...@@ -26,7 +26,7 @@ class FitnessDemo extends StatelessComponent {
} }
} }
class _FitnessDemoContents extends StatefulComponent { class _FitnessDemoContents extends StatefulWidget {
_FitnessDemoContents({ Key key }) : super(key: key); _FitnessDemoContents({ Key key }) : super(key: key);
_FitnessDemoContentsState createState() => new _FitnessDemoContentsState(); _FitnessDemoContentsState createState() => new _FitnessDemoContentsState();
} }
...@@ -102,11 +102,11 @@ class _FitnessDemoContentsState extends State<_FitnessDemoContents> { ...@@ -102,11 +102,11 @@ class _FitnessDemoContentsState extends State<_FitnessDemoContents> {
) )
), ),
new Padding( new Padding(
padding: new EdgeDims.only(top: 20.0), padding: new EdgeInsets.only(top: 20.0),
child: new Text("JUMPING JACKS", style: Theme.of(context).text.title) child: new Text("JUMPING JACKS", style: Theme.of(context).textTheme.title)
), ),
new Padding( new Padding(
padding: new EdgeDims.only(top: 20.0, bottom: 20.0), padding: new EdgeInsets.only(top: 20.0, bottom: 20.0),
child: new Row( child: new Row(
justifyContent: FlexJustifyContent.center, justifyContent: FlexJustifyContent.center,
children: <Widget>[ children: <Widget>[
...@@ -117,7 +117,7 @@ class _FitnessDemoContentsState extends State<_FitnessDemoContents> { ...@@ -117,7 +117,7 @@ class _FitnessDemoContentsState extends State<_FitnessDemoContents> {
) )
), ),
new Padding( new Padding(
padding: new EdgeDims.only(bottom: 16.0), padding: new EdgeInsets.only(bottom: 16.0),
child: new SizedBox( child: new SizedBox(
width: 300.0, width: 300.0,
height: 72.0, height: 72.0,
...@@ -510,7 +510,7 @@ class _JumpingJackPart extends Sprite { ...@@ -510,7 +510,7 @@ class _JumpingJackPart extends Sprite {
} }
} }
class _Fireworks extends StatefulComponent { class _Fireworks extends StatefulWidget {
_Fireworks({ Key key }) : super(key: key); _Fireworks({ Key key }) : super(key: key);
_FireworksState createState() => new _FireworksState(); _FireworksState createState() => new _FireworksState();
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
class _ContactCategory extends StatelessComponent { class _ContactCategory extends StatelessWidget {
_ContactCategory({ Key key, this.icon, this.children }) : super(key: key); _ContactCategory({ Key key, this.icon, this.children }) : super(key: key);
final IconData icon; final IconData icon;
...@@ -13,12 +13,12 @@ class _ContactCategory extends StatelessComponent { ...@@ -13,12 +13,12 @@ class _ContactCategory extends StatelessComponent {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Container( return new Container(
padding: const EdgeDims.symmetric(vertical: 16.0), padding: const EdgeInsets.symmetric(vertical: 16.0),
decoration: new BoxDecoration( decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(color: Theme.of(context).dividerColor)) border: new Border(bottom: new BorderSide(color: Theme.of(context).dividerColor))
), ),
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: Theme.of(context).text.subhead, style: Theme.of(context).textTheme.subhead,
child: new Row( child: new Row(
children: <Widget>[ children: <Widget>[
new SizedBox( new SizedBox(
...@@ -33,7 +33,7 @@ class _ContactCategory extends StatelessComponent { ...@@ -33,7 +33,7 @@ class _ContactCategory extends StatelessComponent {
} }
} }
class _ContactItem extends StatelessComponent { class _ContactItem extends StatelessWidget {
_ContactItem({ Key key, this.icon, this.lines }) : super(key: key) { _ContactItem({ Key key, this.icon, this.lines }) : super(key: key) {
assert(lines.length > 1); assert(lines.length > 1);
} }
...@@ -43,7 +43,7 @@ class _ContactItem extends StatelessComponent { ...@@ -43,7 +43,7 @@ class _ContactItem extends StatelessComponent {
Widget build(BuildContext context) { Widget build(BuildContext context) {
List<Widget> columnChildren = lines.sublist(0, lines.length - 1).map((String line) => new Text(line)).toList(); List<Widget> columnChildren = lines.sublist(0, lines.length - 1).map((String line) => new Text(line)).toList();
columnChildren.add(new Text(lines.last, style: Theme.of(context).text.caption)); columnChildren.add(new Text(lines.last, style: Theme.of(context).textTheme.caption));
List<Widget> rowChildren = <Widget>[ List<Widget> rowChildren = <Widget>[
new Column( new Column(
...@@ -58,7 +58,7 @@ class _ContactItem extends StatelessComponent { ...@@ -58,7 +58,7 @@ class _ContactItem extends StatelessComponent {
)); ));
} }
return new Padding( return new Padding(
padding: const EdgeDims.symmetric(vertical: 16.0), padding: const EdgeInsets.symmetric(vertical: 16.0),
child: new Row( child: new Row(
justifyContent: FlexJustifyContent.spaceBetween, justifyContent: FlexJustifyContent.spaceBetween,
children: rowChildren children: rowChildren
...@@ -67,7 +67,7 @@ class _ContactItem extends StatelessComponent { ...@@ -67,7 +67,7 @@ class _ContactItem extends StatelessComponent {
} }
} }
class FlexibleSpaceDemo extends StatefulComponent { class FlexibleSpaceDemo extends StatefulWidget {
FlexibleSpaceDemoState createState() => new FlexibleSpaceDemoState(); FlexibleSpaceDemoState createState() => new FlexibleSpaceDemoState();
} }
...@@ -109,7 +109,7 @@ class FlexibleSpaceDemoState extends State<FlexibleSpaceDemo> { ...@@ -109,7 +109,7 @@ class FlexibleSpaceDemoState extends State<FlexibleSpaceDemo> {
), ),
body: new Block( body: new Block(
scrollableKey: scrollableKey, scrollableKey: scrollableKey,
padding: new EdgeDims.only(top: appBarHeight), padding: new EdgeInsets.only(top: appBarHeight),
children: <Widget>[ children: <Widget>[
new _ContactCategory( new _ContactCategory(
icon: Icons.call, icon: Icons.call,
......
...@@ -15,7 +15,7 @@ enum DismissDialogAction { ...@@ -15,7 +15,7 @@ enum DismissDialogAction {
save, save,
} }
class DateTimeItem extends StatelessComponent { class DateTimeItem extends StatelessWidget {
DateTimeItem({ Key key, DateTime dateTime, this.onChanged }) DateTimeItem({ Key key, DateTime dateTime, this.onChanged })
: date = new DateTime(dateTime.year, dateTime.month, dateTime.day), : date = new DateTime(dateTime.year, dateTime.month, dateTime.day),
time = new TimeOfDay(hour: dateTime.hour, minute: dateTime.minute), time = new TimeOfDay(hour: dateTime.hour, minute: dateTime.minute),
...@@ -31,12 +31,12 @@ class DateTimeItem extends StatelessComponent { ...@@ -31,12 +31,12 @@ class DateTimeItem extends StatelessComponent {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
return new DefaultTextStyle( return new DefaultTextStyle(
style: theme.text.subhead, style: theme.textTheme.subhead,
child: new Row( child: new Row(
children: <Widget>[ children: <Widget>[
new Flexible( new Flexible(
child: new Container( child: new Container(
padding: const EdgeDims.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 8.0),
decoration: new BoxDecoration( decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(color: theme.dividerColor)) border: new Border(bottom: new BorderSide(color: theme.dividerColor))
), ),
...@@ -63,8 +63,8 @@ class DateTimeItem extends StatelessComponent { ...@@ -63,8 +63,8 @@ class DateTimeItem extends StatelessComponent {
) )
), ),
new Container( new Container(
margin: const EdgeDims.only(left: 8.0), margin: const EdgeInsets.only(left: 8.0),
padding: const EdgeDims.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 8.0),
decoration: new BoxDecoration( decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(color: theme.dividerColor)) border: new Border(bottom: new BorderSide(color: theme.dividerColor))
), ),
...@@ -92,7 +92,7 @@ class DateTimeItem extends StatelessComponent { ...@@ -92,7 +92,7 @@ class DateTimeItem extends StatelessComponent {
} }
} }
class FullScreenDialogDemo extends StatefulComponent { class FullScreenDialogDemo extends StatefulWidget {
FullScreenDialogDemoState createState() => new FullScreenDialogDemoState(); FullScreenDialogDemoState createState() => new FullScreenDialogDemoState();
} }
...@@ -109,7 +109,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> { ...@@ -109,7 +109,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
} }
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final TextStyle dialogTextStyle = theme.text.subhead.copyWith(color: theme.text.caption.color); final TextStyle dialogTextStyle = theme.textTheme.subhead.copyWith(color: theme.textTheme.caption.color);
showDialog( showDialog(
context: context, context: context,
...@@ -149,7 +149,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> { ...@@ -149,7 +149,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
center: new Text('New Event'), center: new Text('New Event'),
right: <Widget> [ right: <Widget> [
new FlatButton( new FlatButton(
child: new Text('SAVE', style: theme.text.body1.copyWith(color: Colors.white)), child: new Text('SAVE', style: theme.textTheme.body1.copyWith(color: Colors.white)),
onPressed: () { onPressed: () {
Navigator.pop(context, DismissDialogAction.save); Navigator.pop(context, DismissDialogAction.save);
} }
...@@ -157,37 +157,37 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> { ...@@ -157,37 +157,37 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
] ]
), ),
body: new Padding( body: new Padding(
padding: const EdgeDims.all(16.0), padding: const EdgeInsets.all(16.0),
child: new ScrollableViewport( child: new ScrollableViewport(
child: new Column( child: new Column(
alignItems: FlexAlignItems.stretch, alignItems: FlexAlignItems.stretch,
justifyContent: FlexJustifyContent.collapse, justifyContent: FlexJustifyContent.collapse,
children: <Widget>[ children: <Widget>[
new Container( new Container(
padding: const EdgeDims.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 8.0),
decoration: new BoxDecoration( decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(color: theme.dividerColor)) border: new Border(bottom: new BorderSide(color: theme.dividerColor))
), ),
child: new Align( child: new Align(
alignment: const FractionalOffset(0.0, 1.0), alignment: const FractionalOffset(0.0, 1.0),
child: new Text('Event name', style: theme.text.display2) child: new Text('Event name', style: theme.textTheme.display2)
) )
), ),
new Container( new Container(
padding: const EdgeDims.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 8.0),
decoration: new BoxDecoration( decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(color: theme.dividerColor)) border: new Border(bottom: new BorderSide(color: theme.dividerColor))
), ),
child: new Align( child: new Align(
alignment: const FractionalOffset(0.0, 1.0), alignment: const FractionalOffset(0.0, 1.0),
child: new Text('Location', style: theme.text.title.copyWith(color: Colors.black54)) child: new Text('Location', style: theme.textTheme.title.copyWith(color: Colors.black54))
) )
), ),
new Column( new Column(
alignItems: FlexAlignItems.stretch, alignItems: FlexAlignItems.stretch,
justifyContent: FlexJustifyContent.end, justifyContent: FlexJustifyContent.end,
children: <Widget>[ children: <Widget>[
new Text('From', style: theme.text.caption), new Text('From', style: theme.textTheme.caption),
new DateTimeItem( new DateTimeItem(
dateTime: fromDateTime, dateTime: fromDateTime,
onChanged: (DateTime value) { onChanged: (DateTime value) {
...@@ -203,7 +203,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> { ...@@ -203,7 +203,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
alignItems: FlexAlignItems.stretch, alignItems: FlexAlignItems.stretch,
justifyContent: FlexJustifyContent.end, justifyContent: FlexJustifyContent.end,
children: <Widget>[ children: <Widget>[
new Text('To', style: theme.text.caption), new Text('To', style: theme.textTheme.caption),
new DateTimeItem( new DateTimeItem(
dateTime: toDateTime, dateTime: toDateTime,
onChanged: (DateTime value) { onChanged: (DateTime value) {
...@@ -237,7 +237,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> { ...@@ -237,7 +237,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
] ]
.map((Widget child) { .map((Widget child) {
return new Container( return new Container(
padding: const EdgeDims.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 8.0),
height: 96.0, height: 96.0,
child: child child: child
); );
......
...@@ -28,7 +28,7 @@ final List<Photo> photos = new List<Photo>.generate(16, (int index) { ...@@ -28,7 +28,7 @@ final List<Photo> photos = new List<Photo>.generate(16, (int index) {
return const Photo(assetName: 'packages/flutter_gallery_assets/kangaroo_valley_safari.png'); return const Photo(assetName: 'packages/flutter_gallery_assets/kangaroo_valley_safari.png');
}); });
class GridDemoPhotoItem extends StatelessComponent { class GridDemoPhotoItem extends StatelessWidget {
GridDemoPhotoItem({ Key key, this.photo, this.tileStyle }) : super(key: key) { GridDemoPhotoItem({ Key key, this.photo, this.tileStyle }) : super(key: key) {
assert(photo != null && photo.isValid); assert(photo != null && photo.isValid);
assert(tileStyle != null); assert(tileStyle != null);
...@@ -97,7 +97,7 @@ class GridListDemoGridDelegate extends FixedColumnCountGridDelegate { ...@@ -97,7 +97,7 @@ class GridListDemoGridDelegate extends FixedColumnCountGridDelegate {
this.columnCount, this.columnCount,
double columnSpacing: 0.0, double columnSpacing: 0.0,
double rowSpacing: 0.0, double rowSpacing: 0.0,
EdgeDims padding: EdgeDims.zero, EdgeInsets padding: EdgeInsets.zero,
this.tileHeightFactor: 2.75 this.tileHeightFactor: 2.75
}) : super(columnSpacing: columnSpacing, rowSpacing: rowSpacing, padding: padding) { }) : super(columnSpacing: columnSpacing, rowSpacing: rowSpacing, padding: padding) {
assert(columnCount != null && columnCount >= 0); assert(columnCount != null && columnCount >= 0);
...@@ -128,7 +128,7 @@ class GridListDemoGridDelegate extends FixedColumnCountGridDelegate { ...@@ -128,7 +128,7 @@ class GridListDemoGridDelegate extends FixedColumnCountGridDelegate {
} }
} }
class GridListDemo extends StatefulComponent { class GridListDemo extends StatefulWidget {
GridListDemo({ Key key }) : super(key: key); GridListDemo({ Key key }) : super(key: key);
GridListDemoState createState() => new GridListDemoState(); GridListDemoState createState() => new GridListDemoState();
...@@ -153,7 +153,7 @@ class GridListDemoState extends State<GridListDemo> { ...@@ -153,7 +153,7 @@ class GridListDemoState extends State<GridListDemo> {
) )
]; ];
final EdgeDims padding = MediaQuery.of(context).padding; final EdgeInsets padding = MediaQuery.of(context).padding;
final ModalPosition position = new ModalPosition( final ModalPosition position = new ModalPosition(
right: padding.right + 16.0, right: padding.right + 16.0,
top: padding.top + 16.0 top: padding.top + 16.0
...@@ -187,7 +187,7 @@ class GridListDemoState extends State<GridListDemo> { ...@@ -187,7 +187,7 @@ class GridListDemoState extends State<GridListDemo> {
columnCount: (orientation == Orientation.portrait) ? 2 : 3, columnCount: (orientation == Orientation.portrait) ? 2 : 3,
rowSpacing: 4.0, rowSpacing: 4.0,
columnSpacing: 4.0, columnSpacing: 4.0,
padding: const EdgeDims.all(4.0), padding: const EdgeInsets.all(4.0),
tileHeightFactor: (orientation == Orientation.portrait) ? 2.75 : 1.75 tileHeightFactor: (orientation == Orientation.portrait) ? 2.75 : 1.75
), ),
children: photos.map((Photo photo) { children: photos.map((Photo photo) {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class IconsDemo extends StatefulComponent { class IconsDemo extends StatefulWidget {
IconsDemoState createState() => new IconsDemoState(); IconsDemoState createState() => new IconsDemoState();
} }
...@@ -63,7 +63,7 @@ class IconsDemoState extends State<IconsDemo> { ...@@ -63,7 +63,7 @@ class IconsDemoState extends State<IconsDemo> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final TextStyle textStyle = theme.text.subhead.copyWith(color: theme.text.caption.color); final TextStyle textStyle = theme.textTheme.subhead.copyWith(color: theme.textTheme.caption.color);
return new Scaffold( return new Scaffold(
toolBar: new ToolBar( toolBar: new ToolBar(
...@@ -72,7 +72,7 @@ class IconsDemoState extends State<IconsDemo> { ...@@ -72,7 +72,7 @@ class IconsDemoState extends State<IconsDemo> {
body: new IconTheme( body: new IconTheme(
data: new IconThemeData(opacity: iconOpacity), data: new IconThemeData(opacity: iconOpacity),
child: new Padding( child: new Padding(
padding: const EdgeDims.all(24.0), padding: const EdgeInsets.all(24.0),
child: new Column( child: new Column(
children: <Widget>[ children: <Widget>[
new Row( new Row(
......
...@@ -25,7 +25,7 @@ class LeaveBehindItem { ...@@ -25,7 +25,7 @@ class LeaveBehindItem {
final String body; final String body;
} }
class LeaveBehindDemo extends StatefulComponent { class LeaveBehindDemo extends StatefulWidget {
LeaveBehindDemo({ Key key }) : super(key: key); LeaveBehindDemo({ Key key }) : super(key: key);
LeaveBehindDemoState createState() => new LeaveBehindDemoState(); LeaveBehindDemoState createState() => new LeaveBehindDemoState();
...@@ -156,7 +156,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> { ...@@ -156,7 +156,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
] ]
), ),
body: new Block( body: new Block(
padding: new EdgeDims.all(4.0), padding: new EdgeInsets.all(4.0),
children: leaveBehindItems.map(buildItem).toList() children: leaveBehindItems.map(buildItem).toList()
) )
); );
......
...@@ -10,7 +10,7 @@ enum ListDemoItemSize { ...@@ -10,7 +10,7 @@ enum ListDemoItemSize {
threeLine threeLine
} }
class ListDemo extends StatefulComponent { class ListDemo extends StatefulWidget {
ListDemo({ Key key }) : super(key: key); ListDemo({ Key key }) : super(key: key);
ListDemoState createState() => new ListDemoState(); ListDemoState createState() => new ListDemoState();
...@@ -195,7 +195,7 @@ class ListDemoState extends State<ListDemo> { ...@@ -195,7 +195,7 @@ class ListDemoState extends State<ListDemo> {
] ]
), ),
body: new Block( body: new Block(
padding: new EdgeDims.all(_dense ? 4.0 : 8.0), padding: new EdgeInsets.all(_dense ? 4.0 : 8.0),
children: listItems.toList() children: listItems.toList()
) )
); );
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class MenuDemo extends StatefulComponent { class MenuDemo extends StatefulWidget {
MenuDemo({ Key key }) : super(key: key); MenuDemo({ Key key }) : super(key: key);
MenuDemoState createState() => new MenuDemoState(); MenuDemoState createState() => new MenuDemoState();
...@@ -79,7 +79,7 @@ class MenuDemoState extends State<MenuDemo> { ...@@ -79,7 +79,7 @@ class MenuDemoState extends State<MenuDemo> {
] ]
), ),
body: new Block( body: new Block(
padding: const EdgeDims.all(8.0), padding: const EdgeInsets.all(8.0),
children: <Widget>[ children: <Widget>[
// Pressing the PopupMenuButton on the right of this item shows // Pressing the PopupMenuButton on the right of this item shows
// a simple menu with one disabled item. Typically the contents // a simple menu with one disabled item. Typically the contents
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ModalBottomSheetDemo extends StatelessComponent { class ModalBottomSheetDemo extends StatelessWidget {
final TextStyle textStyle = new TextStyle( final TextStyle textStyle = new TextStyle(
color: Colors.indigo[400], color: Colors.indigo[400],
fontSize: 24.0, fontSize: 24.0,
...@@ -24,7 +24,7 @@ class ModalBottomSheetDemo extends StatelessComponent { ...@@ -24,7 +24,7 @@ class ModalBottomSheetDemo extends StatelessComponent {
showModalBottomSheet/*<Null>*/(context: context, builder: (BuildContext context) { showModalBottomSheet/*<Null>*/(context: context, builder: (BuildContext context) {
return new Container( return new Container(
child: new Padding( child: new Padding(
padding: const EdgeDims.all(32.0), padding: const EdgeInsets.all(32.0),
child: new Text("This is the modal bottom sheet. Click anywhere to dismiss.", style: textStyle) child: new Text("This is the modal bottom sheet. Click anywhere to dismiss.", style: textStyle)
) )
); );
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class PageSelectorDemo extends StatelessComponent { class PageSelectorDemo extends StatelessWidget {
void _handleArrowButtonPress(BuildContext context, int delta) { void _handleArrowButtonPress(BuildContext context, int delta) {
final TabBarSelectionState<IconData> selection = TabBarSelection.of/*<IconData>*/(context); final TabBarSelectionState<IconData> selection = TabBarSelection.of/*<IconData>*/(context);
...@@ -32,7 +32,7 @@ class PageSelectorDemo extends StatelessComponent { ...@@ -32,7 +32,7 @@ class PageSelectorDemo extends StatelessComponent {
return new Column( return new Column(
children: <Widget>[ children: <Widget>[
new Container( new Container(
margin: const EdgeDims.only(top: 16.0), margin: const EdgeInsets.only(top: 16.0),
child: new Row( child: new Row(
children: <Widget>[ children: <Widget>[
new IconButton( new IconButton(
...@@ -57,7 +57,7 @@ class PageSelectorDemo extends StatelessComponent { ...@@ -57,7 +57,7 @@ class PageSelectorDemo extends StatelessComponent {
children: icons.map((IconData icon) { children: icons.map((IconData icon) {
return new Container( return new Container(
key: new ObjectKey(icon), key: new ObjectKey(icon),
padding: const EdgeDims.all(12.0), padding: const EdgeInsets.all(12.0),
child: new Card( child: new Card(
child: new Center( child: new Center(
child: new Icon(icon: icon, size: 128.0, color: color) child: new Icon(icon: icon, size: 128.0, color: color)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class PersistentBottomSheetDemo extends StatelessComponent { class PersistentBottomSheetDemo extends StatelessWidget {
final TextStyle textStyle = new TextStyle( final TextStyle textStyle = new TextStyle(
color: Colors.indigo[400], color: Colors.indigo[400],
...@@ -19,7 +19,7 @@ class PersistentBottomSheetDemo extends StatelessComponent { ...@@ -19,7 +19,7 @@ class PersistentBottomSheetDemo extends StatelessComponent {
border: new Border(top: new BorderSide(color: Colors.black26, width: 1.0)) border: new Border(top: new BorderSide(color: Colors.black26, width: 1.0))
), ),
child: new Padding( child: new Padding(
padding: const EdgeDims.all(32.0), padding: const EdgeInsets.all(32.0),
child: new Text("This is a Material persistent bottom sheet. Drag downwards to dismiss it.", style: textStyle) child: new Text("This is a Material persistent bottom sheet. Drag downwards to dismiss it.", style: textStyle)
) )
); );
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ProgressIndicatorDemo extends StatefulComponent { class ProgressIndicatorDemo extends StatefulWidget {
_ProgressIndicatorDemoState createState() => new _ProgressIndicatorDemoState(); _ProgressIndicatorDemoState createState() => new _ProgressIndicatorDemoState();
} }
...@@ -75,7 +75,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> { ...@@ -75,7 +75,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> {
]; ];
return new Column( return new Column(
children: indicators children: indicators
.map((Widget c) => new Container(child: c, margin: const EdgeDims.symmetric(vertical: 15.0, horizontal: 20.0))) .map((Widget c) => new Container(child: c, margin: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0)))
.toList(), .toList(),
justifyContent: FlexJustifyContent.center justifyContent: FlexJustifyContent.center
); );
...@@ -85,12 +85,12 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> { ...@@ -85,12 +85,12 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> {
return new Scaffold( return new Scaffold(
toolBar: new ToolBar(center: new Text('Progress Indicators')), toolBar: new ToolBar(center: new Text('Progress Indicators')),
body: new DefaultTextStyle( body: new DefaultTextStyle(
style: Theme.of(context).text.title, style: Theme.of(context).textTheme.title,
child: new GestureDetector( child: new GestureDetector(
onTap: _handleTap, onTap: _handleTap,
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
child: new Container( child: new Container(
padding: const EdgeDims.symmetric(vertical: 12.0, horizontal: 8.0), padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 8.0),
child: new AnimatedBuilder( child: new AnimatedBuilder(
animation: animation, animation: animation,
builder: _buildIndicators builder: _buildIndicators
......
...@@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; ...@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
import 'flexible_space_demo.dart'; import 'flexible_space_demo.dart';
class _BarGraphic extends StatelessComponent { class _BarGraphic extends StatelessWidget {
_BarGraphic({ Key key, this.height, this.color, this.leftText, this.rightText: '' }) _BarGraphic({ Key key, this.height, this.color, this.leftText, this.rightText: '' })
: super(key: key) { : super(key: key) {
assert(height != null); assert(height != null);
...@@ -23,10 +23,10 @@ class _BarGraphic extends StatelessComponent { ...@@ -23,10 +23,10 @@ class _BarGraphic extends StatelessComponent {
return new Container( return new Container(
height: height, height: height,
width: 200.0, width: 200.0,
padding: const EdgeDims.symmetric(horizontal: 16.0), padding: const EdgeInsets.symmetric(horizontal: 16.0),
decoration: new BoxDecoration(backgroundColor: color), decoration: new BoxDecoration(backgroundColor: color),
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: Theme.of(context).text.body1.copyWith(color: Colors.white), style: Theme.of(context).textTheme.body1.copyWith(color: Colors.white),
child: new Row( child: new Row(
justifyContent: FlexJustifyContent.spaceBetween, justifyContent: FlexJustifyContent.spaceBetween,
children: <Widget>[ children: <Widget>[
...@@ -74,7 +74,7 @@ class _FlexibleSpaceGraphic extends _BarGraphic { ...@@ -74,7 +74,7 @@ class _FlexibleSpaceGraphic extends _BarGraphic {
); );
} }
class _TechniqueItem extends StatelessComponent { class _TechniqueItem extends StatelessWidget {
_TechniqueItem({ this.titleText, this.barGraphics, this.builder }); _TechniqueItem({ this.titleText, this.barGraphics, this.builder });
final String titleText; final String titleText;
...@@ -90,7 +90,7 @@ class _TechniqueItem extends StatelessComponent { ...@@ -90,7 +90,7 @@ class _TechniqueItem extends StatelessComponent {
child: new InkWell( child: new InkWell(
onTap: () { showDemo(context); }, onTap: () { showDemo(context); },
child: new Padding( child: new Padding(
padding: const EdgeDims.all(16.0), padding: const EdgeInsets.all(16.0),
child: new Row( child: new Row(
justifyContent: FlexJustifyContent.spaceBetween, justifyContent: FlexJustifyContent.spaceBetween,
children :<Widget>[ children :<Widget>[
...@@ -110,17 +110,17 @@ const String _introText = ...@@ -110,17 +110,17 @@ const String _introText =
"it appears behind the device's status bar. When a flexible space Widget is " "it appears behind the device's status bar. When a flexible space Widget is "
"specified it is stacked on top of the ToolBar."; "specified it is stacked on top of the ToolBar.";
class ScrollingTechniquesDemo extends StatelessComponent { class ScrollingTechniquesDemo extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Scaffold( return new Scaffold(
toolBar: new ToolBar(center: new Text('Scrolling Techniques')), toolBar: new ToolBar(center: new Text('Scrolling Techniques')),
body: new Padding( body: new Padding(
padding: const EdgeDims.symmetric(horizontal: 16.0), padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: new Block( child: new Block(
children: <Widget>[ children: <Widget>[
new Padding( new Padding(
padding: const EdgeDims.symmetric(horizontal: 16.0, vertical: 32.0), padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 32.0),
child: new Text(_introText, style: Theme.of(context).text.caption) child: new Text(_introText, style: Theme.of(context).textTheme.caption)
), ),
new _TechniqueItem( new _TechniqueItem(
builder: (BuildContext context) => new FlexibleSpaceDemo(), builder: (BuildContext context) => new FlexibleSpaceDemo(),
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class SliderDemo extends StatefulComponent { class SliderDemo extends StatefulWidget {
_SliderDemoState createState() => new _SliderDemoState(); _SliderDemoState createState() => new _SliderDemoState();
} }
...@@ -31,7 +31,7 @@ class _SliderDemoState extends State<SliderDemo> { ...@@ -31,7 +31,7 @@ class _SliderDemoState extends State<SliderDemo> {
} }
), ),
new Container( new Container(
padding: const EdgeDims.symmetric(horizontal: 16.0), padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: new Text(_value.round().toString().padLeft(3, '0')) child: new Text(_value.round().toString().padLeft(3, '0'))
), ),
], ],
...@@ -47,7 +47,7 @@ class _SliderDemoState extends State<SliderDemo> { ...@@ -47,7 +47,7 @@ class _SliderDemoState extends State<SliderDemo> {
// Disabled, but tracking the slider above. // Disabled, but tracking the slider above.
new Slider(value: _value / 100.0), new Slider(value: _value / 100.0),
new Container( new Container(
padding: const EdgeDims.symmetric(horizontal: 16.0), padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: new Text((_value / 100.0).toStringAsFixed(2)) child: new Text((_value / 100.0).toStringAsFixed(2))
), ),
], ],
......
...@@ -17,12 +17,12 @@ const String _text2 = ...@@ -17,12 +17,12 @@ const String _text2 =
const String _text3 = const String _text3 =
"By default snackbars automatically disappear after a few seconds "; "By default snackbars automatically disappear after a few seconds ";
class SnackBarDemo extends StatelessComponent { class SnackBarDemo extends StatelessWidget {
SnackBarDemo({ Key key }) : super(key: key); SnackBarDemo({ Key key }) : super(key: key);
Widget buildBody(BuildContext context) { Widget buildBody(BuildContext context) {
return new Padding( return new Padding(
padding: const EdgeDims.all(24.0), padding: const EdgeInsets.all(24.0),
child: new Column( child: new Column(
children: <Widget>[ children: <Widget>[
new Text(_text1), new Text(_text1),
...@@ -47,7 +47,7 @@ class SnackBarDemo extends StatelessComponent { ...@@ -47,7 +47,7 @@ class SnackBarDemo extends StatelessComponent {
] ]
.map((Widget child) { .map((Widget child) {
return new Container( return new Container(
margin: const EdgeDims.symmetric(vertical: 12.0), margin: const EdgeInsets.symmetric(vertical: 12.0),
child: child child: child
); );
}) })
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class TabsDemo extends StatelessComponent { class TabsDemo extends StatelessWidget {
final List<IconData> icons = <IconData>[ final List<IconData> icons = <IconData>[
Icons.event, Icons.event,
Icons.home, Icons.home,
...@@ -42,7 +42,7 @@ class TabsDemo extends StatelessComponent { ...@@ -42,7 +42,7 @@ class TabsDemo extends StatelessComponent {
children: icons.map((IconData icon) { children: icons.map((IconData icon) {
return new Container( return new Container(
key: new ObjectKey(icon), key: new ObjectKey(icon),
padding: const EdgeDims.all(12.0), padding: const EdgeInsets.all(12.0),
child: new Card( child: new Card(
child: new Center( child: new Center(
child: new Icon( child: new Icon(
......
...@@ -25,7 +25,7 @@ const String _explanatoryText = ...@@ -25,7 +25,7 @@ const String _explanatoryText =
"with a FloatingActionButton that the Scaffold distinguishes from the others " "with a FloatingActionButton that the Scaffold distinguishes from the others "
"by its key."; "by its key.";
class TabsFabDemo extends StatefulComponent { class TabsFabDemo extends StatefulWidget {
_TabsFabDemoState createState() => new _TabsFabDemoState(); _TabsFabDemoState createState() => new _TabsFabDemoState();
} }
...@@ -59,8 +59,8 @@ class _TabsFabDemoState extends State<TabsFabDemo> { ...@@ -59,8 +59,8 @@ class _TabsFabDemoState extends State<TabsFabDemo> {
border: new Border(top: new BorderSide(color: Theme.of(context).dividerColor)) border: new Border(top: new BorderSide(color: Theme.of(context).dividerColor))
), ),
child: new Padding( child: new Padding(
padding: const EdgeDims.all(32.0), padding: const EdgeInsets.all(32.0),
child: new Text(_explanatoryText, style: Theme.of(context).text.subhead) child: new Text(_explanatoryText, style: Theme.of(context).textTheme.subhead)
) )
); );
}); });
...@@ -77,7 +77,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> { ...@@ -77,7 +77,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> {
return new Container( return new Container(
key: new ValueKey<String>(page.label), key: new ValueKey<String>(page.label),
padding: const EdgeDims.TRBL(48.0, 48.0, 96.0, 48.0), padding: const EdgeInsets.TRBL(48.0, 48.0, 96.0, 48.0),
child: new Card( child: new Card(
child: new Center( child: new Center(
child: new Text(page.label, style: textStyle) child: new Text(page.label, style: textStyle)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class TextFieldDemo extends StatefulComponent { class TextFieldDemo extends StatefulWidget {
TextFieldDemo({ Key key }) : super(key: key); TextFieldDemo({ Key key }) : super(key: key);
TextFieldDemoState createState() => new TextFieldDemoState(); TextFieldDemoState createState() => new TextFieldDemoState();
...@@ -66,7 +66,7 @@ class TextFieldDemoState extends State<TextFieldDemo> { ...@@ -66,7 +66,7 @@ class TextFieldDemoState extends State<TextFieldDemo> {
center: new Text('Text Fields') center: new Text('Text Fields')
), ),
body: new Block( body: new Block(
padding: const EdgeDims.all(8.0), padding: const EdgeInsets.all(8.0),
children: <Widget>[ children: <Widget>[
new Input( new Input(
hintText: 'What do people call you?', hintText: 'What do people call you?',
......
...@@ -6,7 +6,7 @@ import 'dart:async'; ...@@ -6,7 +6,7 @@ import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class TimePickerDemo extends StatefulComponent { class TimePickerDemo extends StatefulWidget {
_TimePickerDemoState createState() => new _TimePickerDemoState(); _TimePickerDemoState createState() => new _TimePickerDemoState();
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ToggleControlsDemo extends StatefulComponent { class ToggleControlsDemo extends StatefulWidget {
_ToggleControlsDemoState createState() => new _ToggleControlsDemoState(); _ToggleControlsDemoState createState() => new _ToggleControlsDemoState();
} }
......
...@@ -9,7 +9,7 @@ const String _introText = ...@@ -9,7 +9,7 @@ const String _introText =
"a long press. Tooltip messages are also used by services that make Flutter " "a long press. Tooltip messages are also used by services that make Flutter "
"apps accessible, like screen readers."; "apps accessible, like screen readers.";
class TooltipDemo extends StatelessComponent { class TooltipDemo extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
return new Scaffold( return new Scaffold(
...@@ -21,10 +21,10 @@ class TooltipDemo extends StatelessComponent { ...@@ -21,10 +21,10 @@ class TooltipDemo extends StatelessComponent {
return new Column( return new Column(
alignItems: FlexAlignItems.stretch, alignItems: FlexAlignItems.stretch,
children: <Widget>[ children: <Widget>[
new Text(_introText, style: theme.text.subhead), new Text(_introText, style: theme.textTheme.subhead),
new Row( new Row(
children: <Widget>[ children: <Widget>[
new Text('Long press the ', style: theme.text.subhead), new Text('Long press the ', style: theme.textTheme.subhead),
new Tooltip( new Tooltip(
message: 'call icon', message: 'call icon',
child: new Icon( child: new Icon(
...@@ -33,7 +33,7 @@ class TooltipDemo extends StatelessComponent { ...@@ -33,7 +33,7 @@ class TooltipDemo extends StatelessComponent {
color: theme.primaryColor color: theme.primaryColor
) )
), ),
new Text(' icon', style: theme.text.subhead) new Text(' icon', style: theme.textTheme.subhead)
] ]
), ),
new Center( new Center(
...@@ -52,7 +52,7 @@ class TooltipDemo extends StatelessComponent { ...@@ -52,7 +52,7 @@ class TooltipDemo extends StatelessComponent {
] ]
.map((Widget widget) { .map((Widget widget) {
return new Padding( return new Padding(
padding: const EdgeDims.only(top: 16.0, left: 16.0, right: 16.0), padding: const EdgeInsets.only(top: 16.0, left: 16.0, right: 16.0),
child: widget child: widget
); );
}) })
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class TwoLevelListDemo extends StatelessComponent { class TwoLevelListDemo extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Scaffold( return new Scaffold(
toolBar: new ToolBar(center: new Text('Expand/Collapse List Control')), toolBar: new ToolBar(center: new Text('Expand/Collapse List Control')),
body: new Padding( body: new Padding(
padding: const EdgeDims.all(0.0), padding: const EdgeInsets.all(0.0),
child: new TwoLevelList( child: new TwoLevelList(
type: MaterialListType.oneLine, type: MaterialListType.oneLine,
items: <Widget>[ items: <Widget>[
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
class TextStyleItem extends StatelessComponent { class TextStyleItem extends StatelessWidget {
TextStyleItem({ Key key, this.name, this.style, this.text }) : super(key: key) { TextStyleItem({ Key key, this.name, this.style, this.text }) : super(key: key) {
assert(name != null); assert(name != null);
assert(style != null); assert(style != null);
...@@ -18,9 +18,9 @@ class TextStyleItem extends StatelessComponent { ...@@ -18,9 +18,9 @@ class TextStyleItem extends StatelessComponent {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final TextStyle nameStyle = theme.text.body1.copyWith(color: theme.text.caption.color); final TextStyle nameStyle = theme.textTheme.body1.copyWith(color: theme.textTheme.caption.color);
return new Padding( return new Padding(
padding: const EdgeDims.symmetric(horizontal: 8.0, vertical: 16.0), padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 16.0),
child: new Row( child: new Row(
alignItems: FlexAlignItems.start, alignItems: FlexAlignItems.start,
children: <Widget>[ children: <Widget>[
...@@ -37,9 +37,9 @@ class TextStyleItem extends StatelessComponent { ...@@ -37,9 +37,9 @@ class TextStyleItem extends StatelessComponent {
} }
} }
class TypographyDemo extends StatelessComponent { class TypographyDemo extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final TextTheme textTheme = Theme.of(context).text; final TextTheme textTheme = Theme.of(context).textTheme;
final List<Widget> styleItems = <Widget>[ final List<Widget> styleItems = <Widget>[
new TextStyleItem(name: 'display3', style: textTheme.display3, text: 'Regular 56sp'), new TextStyleItem(name: 'display3', style: textTheme.display3, text: 'Regular 56sp'),
new TextStyleItem(name: 'display2', style: textTheme.display2, text: 'Regular 45sp'), new TextStyleItem(name: 'display2', style: textTheme.display2, text: 'Regular 45sp'),
......
...@@ -17,7 +17,7 @@ enum WeatherType { ...@@ -17,7 +17,7 @@ enum WeatherType {
snow snow
} }
class WeatherDemo extends StatefulComponent { class WeatherDemo extends StatefulWidget {
WeatherDemo({ Key key }) : super(key: key); WeatherDemo({ Key key }) : super(key: key);
_WeatherDemoState createState() => new _WeatherDemoState(); _WeatherDemoState createState() => new _WeatherDemoState();
} }
...@@ -125,7 +125,7 @@ class _WeatherDemoState extends State<WeatherDemo> { ...@@ -125,7 +125,7 @@ class _WeatherDemoState extends State<WeatherDemo> {
const double _kWeatherButtonSize = 56.0; const double _kWeatherButtonSize = 56.0;
const double _kWeatherIconSize = 36.0; const double _kWeatherIconSize = 36.0;
class WeatherButton extends StatelessComponent { class WeatherButton extends StatelessWidget {
WeatherButton({ this.icon, this.selected, this.onPressed, Key key }) : super(key: key); WeatherButton({ this.icon, this.selected, this.onPressed, Key key }) : super(key: key);
final String icon; final String icon;
...@@ -140,7 +140,7 @@ class WeatherButton extends StatelessComponent { ...@@ -140,7 +140,7 @@ class WeatherButton extends StatelessComponent {
color = const Color(0x33000000); color = const Color(0x33000000);
return new Padding( return new Padding(
padding: const EdgeDims.all(15.0), padding: const EdgeInsets.all(15.0),
child: new Material( child: new Material(
color: color, color: color,
type: MaterialType.circle, type: MaterialType.circle,
......
...@@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; ...@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
import 'home.dart'; import 'home.dart';
class GalleryApp extends StatefulComponent { class GalleryApp extends StatefulWidget {
GalleryApp({ Key key }) : super(key: key); GalleryApp({ Key key }) : super(key: key);
static GalleryAppState of(BuildContext context) => context.ancestorStateOfType(const TypeMatcher<GalleryAppState>()); static GalleryAppState of(BuildContext context) => context.ancestorStateOfType(const TypeMatcher<GalleryAppState>());
......
...@@ -8,7 +8,7 @@ import 'package:flutter/widgets.dart'; ...@@ -8,7 +8,7 @@ import 'package:flutter/widgets.dart';
import 'app.dart'; import 'app.dart';
class GalleryDrawer extends StatelessComponent { class GalleryDrawer extends StatelessWidget {
GalleryDrawer({ Key key }) : super(key: key); GalleryDrawer({ Key key }) : super(key: key);
void _changeTheme(BuildContext context, bool value) { void _changeTheme(BuildContext context, bool value) {
......
...@@ -39,7 +39,7 @@ import '../demo/two_level_list_demo.dart'; ...@@ -39,7 +39,7 @@ import '../demo/two_level_list_demo.dart';
import '../demo/typography_demo.dart'; import '../demo/typography_demo.dart';
import '../demo/weather_demo.dart'; import '../demo/weather_demo.dart';
class GalleryHome extends StatefulComponent { class GalleryHome extends StatefulWidget {
GalleryHome({ Key key }) : super(key: key); GalleryHome({ Key key }) : super(key: key);
GalleryHomeState createState() => new GalleryHomeState(); GalleryHomeState createState() => new GalleryHomeState();
...@@ -53,7 +53,7 @@ class GalleryHomeState extends State<GalleryHome> { ...@@ -53,7 +53,7 @@ class GalleryHomeState extends State<GalleryHome> {
toolBar: new ToolBar( toolBar: new ToolBar(
flexibleSpace: (BuildContext context) { flexibleSpace: (BuildContext context) {
return new Container( return new Container(
padding: const EdgeDims.only(left: 16.0, bottom: 24.0), padding: const EdgeInsets.only(left: 16.0, bottom: 24.0),
height: 128.0, height: 128.0,
child: new Align( child: new Align(
alignment: const FractionalOffset(0.0, 1.0), alignment: const FractionalOffset(0.0, 1.0),
...@@ -63,7 +63,7 @@ class GalleryHomeState extends State<GalleryHome> { ...@@ -63,7 +63,7 @@ class GalleryHomeState extends State<GalleryHome> {
} }
), ),
body: new Block( body: new Block(
padding: const EdgeDims.all(4.0), padding: const EdgeInsets.all(4.0),
children: <Widget>[ children: <Widget>[
new Row( new Row(
children: <Widget>[ children: <Widget>[
......
...@@ -7,7 +7,7 @@ import 'package:flutter/widgets.dart'; ...@@ -7,7 +7,7 @@ import 'package:flutter/widgets.dart';
import 'demo.dart'; import 'demo.dart';
class GallerySection extends StatelessComponent { class GallerySection extends StatelessWidget {
GallerySection({ this.title, this.image, this.colors, this.demos }); GallerySection({ this.title, this.image, this.colors, this.demos });
final String title; final String title;
...@@ -45,7 +45,7 @@ class GallerySection extends StatelessComponent { ...@@ -45,7 +45,7 @@ class GallerySection extends StatelessComponent {
body: new Material( body: new Material(
child: new MaterialList( child: new MaterialList(
scrollableKey: scrollableKey, scrollableKey: scrollableKey,
scrollablePadding: new EdgeDims.only(top: appBarHeight), scrollablePadding: new EdgeInsets.only(top: appBarHeight),
type: MaterialListType.oneLine, type: MaterialListType.oneLine,
children: (demos ?? const <GalleryDemo>[]).map((GalleryDemo demo) { children: (demos ?? const <GalleryDemo>[]).map((GalleryDemo demo) {
return new ListItem( return new ListItem(
...@@ -66,7 +66,7 @@ class GallerySection extends StatelessComponent { ...@@ -66,7 +66,7 @@ class GallerySection extends StatelessComponent {
brightness: Theme.of(context).brightness, brightness: Theme.of(context).brightness,
primarySwatch: colors primarySwatch: colors
); );
final TextStyle titleTextStyle = theme.text.title.copyWith( final TextStyle titleTextStyle = theme.textTheme.title.copyWith(
color: Colors.white color: Colors.white
); );
return new Flexible( return new Flexible(
...@@ -75,13 +75,13 @@ class GallerySection extends StatelessComponent { ...@@ -75,13 +75,13 @@ class GallerySection extends StatelessComponent {
onTap: () { showDemos(context); }, onTap: () { showDemos(context); },
child: new Container( child: new Container(
height: 256.0, height: 256.0,
margin: const EdgeDims.all(4.0), margin: const EdgeInsets.all(4.0),
decoration: new BoxDecoration(backgroundColor: theme.primaryColor), decoration: new BoxDecoration(backgroundColor: theme.primaryColor),
child: new Column( child: new Column(
children: <Widget>[ children: <Widget>[
new Flexible( new Flexible(
child: new Padding( child: new Padding(
padding: const EdgeDims.symmetric(horizontal: 12.0), padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: new AssetImage( child: new AssetImage(
name: image, name: image,
alignment: const FractionalOffset(0.5, 0.5), alignment: const FractionalOffset(0.5, 0.5),
...@@ -90,7 +90,7 @@ class GallerySection extends StatelessComponent { ...@@ -90,7 +90,7 @@ class GallerySection extends StatelessComponent {
) )
), ),
new Padding( new Padding(
padding: const EdgeDims.all(16.0), padding: const EdgeInsets.all(16.0),
child: new Align( child: new Align(
alignment: const FractionalOffset(0.0, 1.0), alignment: const FractionalOffset(0.0, 1.0),
child: new Text(title, style: titleTextStyle) child: new Text(title, style: titleTextStyle)
......
...@@ -23,7 +23,7 @@ import 'stock_strings.dart'; ...@@ -23,7 +23,7 @@ import 'stock_strings.dart';
import 'stock_symbol_viewer.dart'; import 'stock_symbol_viewer.dart';
import 'stock_types.dart'; import 'stock_types.dart';
class StocksApp extends StatefulComponent { class StocksApp extends StatefulWidget {
StocksAppState createState() => new StocksAppState(); StocksAppState createState() => new StocksAppState();
} }
......
...@@ -50,7 +50,7 @@ class StockArrowPainter extends CustomPainter { ...@@ -50,7 +50,7 @@ class StockArrowPainter extends CustomPainter {
} }
} }
class StockArrow extends StatelessComponent { class StockArrow extends StatelessWidget {
StockArrow({ Key key, this.percentChange }) : super(key: key); StockArrow({ Key key, this.percentChange }) : super(key: key);
final double percentChange; final double percentChange;
...@@ -71,7 +71,7 @@ class StockArrow extends StatelessComponent { ...@@ -71,7 +71,7 @@ class StockArrow extends StatelessComponent {
return new Container( return new Container(
width: 40.0, width: 40.0,
height: 40.0, height: 40.0,
margin: const EdgeDims.symmetric(horizontal: 5.0), margin: const EdgeInsets.symmetric(horizontal: 5.0),
child: new CustomPaint( child: new CustomPaint(
painter: new StockArrowPainter( painter: new StockArrowPainter(
// TODO(jackson): This should change colors with the theme // TODO(jackson): This should change colors with the theme
......
...@@ -18,7 +18,7 @@ typedef void ModeUpdater(StockMode mode); ...@@ -18,7 +18,7 @@ typedef void ModeUpdater(StockMode mode);
enum _StockMenuItem { autorefresh, refresh, speedUp, speedDown } enum _StockMenuItem { autorefresh, refresh, speedUp, speedDown }
enum StockHomeTab { market, portfolio } enum StockHomeTab { market, portfolio }
class _NotImplementedDialog extends StatelessComponent { class _NotImplementedDialog extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Dialog( return new Dialog(
title: new Text('Not Implemented'), title: new Text('Not Implemented'),
...@@ -50,7 +50,7 @@ class _NotImplementedDialog extends StatelessComponent { ...@@ -50,7 +50,7 @@ class _NotImplementedDialog extends StatelessComponent {
} }
} }
class StockHome extends StatefulComponent { class StockHome extends StatefulWidget {
const StockHome(this.stocks, this.symbols, this.configuration, this.updater); const StockHome(this.stocks, this.symbols, this.configuration, this.updater);
final Map<String, Stock> stocks; final Map<String, Stock> stocks;
...@@ -355,7 +355,7 @@ class StockHomeState extends State<StockHome> { ...@@ -355,7 +355,7 @@ class StockHomeState extends State<StockHome> {
} }
} }
class _CreateCompanySheet extends StatefulComponent { class _CreateCompanySheet extends StatefulWidget {
_CreateCompanySheetState createState() => new _CreateCompanySheetState(); _CreateCompanySheetState createState() => new _CreateCompanySheetState();
} }
......
...@@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; ...@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
import 'stock_data.dart'; import 'stock_data.dart';
import 'stock_row.dart'; import 'stock_row.dart';
class StockList extends StatelessComponent { class StockList extends StatelessWidget {
StockList({ Key key, this.keySalt, this.stocks, this.onOpen, this.onShow, this.onAction }) : super(key: key); StockList({ Key key, this.keySalt, this.stocks, this.onOpen, this.onShow, this.onAction }) : super(key: key);
final Object keySalt; final Object keySalt;
......
...@@ -30,7 +30,7 @@ class StockRowPartKey extends Key { ...@@ -30,7 +30,7 @@ class StockRowPartKey extends Key {
typedef void StockRowActionCallback(Stock stock, Key arrowKey); typedef void StockRowActionCallback(Stock stock, Key arrowKey);
class StockRow extends StatelessComponent { class StockRow extends StatelessWidget {
StockRow({ StockRow({
Stock stock, Stock stock,
Object keySalt, Object keySalt,
...@@ -64,7 +64,7 @@ class StockRow extends StatelessComponent { ...@@ -64,7 +64,7 @@ class StockRow extends StatelessComponent {
onDoubleTap: _getHandler(onDoubleTap), onDoubleTap: _getHandler(onDoubleTap),
onLongPress: _getHandler(onLongPressed), onLongPress: _getHandler(onLongPressed),
child: new Container( child: new Container(
padding: const EdgeDims.TRBL(16.0, 16.0, 20.0, 16.0), padding: const EdgeInsets.TRBL(16.0, 16.0, 20.0, 16.0),
decoration: new BoxDecoration( decoration: new BoxDecoration(
border: new Border( border: new Border(
bottom: new BorderSide(color: Theme.of(context).dividerColor) bottom: new BorderSide(color: Theme.of(context).dividerColor)
...@@ -73,7 +73,7 @@ class StockRow extends StatelessComponent { ...@@ -73,7 +73,7 @@ class StockRow extends StatelessComponent {
child: new Row( child: new Row(
children: <Widget>[ children: <Widget>[
new Container( new Container(
margin: const EdgeDims.only(right: 5.0), margin: const EdgeInsets.only(right: 5.0),
child: new Hero( child: new Hero(
tag: StockRowPartKind.arrow, tag: StockRowPartKind.arrow,
key: _arrowKey, key: _arrowKey,
......
...@@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; ...@@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
import 'stock_types.dart'; import 'stock_types.dart';
class StockSettings extends StatefulComponent { class StockSettings extends StatefulWidget {
const StockSettings(this.configuration, this.updater); const StockSettings(this.configuration, this.updater);
final StockConfiguration configuration; final StockConfiguration configuration;
...@@ -241,7 +241,7 @@ class StockSettingsState extends State<StockSettings> { ...@@ -241,7 +241,7 @@ class StockSettingsState extends State<StockSettings> {
}); });
return new Block( return new Block(
children: rows, children: rows,
padding: const EdgeDims.symmetric(vertical: 20.0) padding: const EdgeInsets.symmetric(vertical: 20.0)
); );
} }
......
...@@ -8,7 +8,7 @@ import 'stock_data.dart'; ...@@ -8,7 +8,7 @@ import 'stock_data.dart';
import 'stock_arrow.dart'; import 'stock_arrow.dart';
import 'stock_row.dart'; import 'stock_row.dart';
class StockSymbolView extends StatelessComponent { class StockSymbolView extends StatelessWidget {
StockSymbolView({ this.stock }); StockSymbolView({ this.stock });
final Stock stock; final Stock stock;
...@@ -19,16 +19,16 @@ class StockSymbolView extends StatelessComponent { ...@@ -19,16 +19,16 @@ class StockSymbolView extends StatelessComponent {
if (stock.percentChange > 0) if (stock.percentChange > 0)
changeInPrice = "+" + changeInPrice; changeInPrice = "+" + changeInPrice;
TextStyle headings = Theme.of(context).text.body2; TextStyle headings = Theme.of(context).textTheme.body2;
return new Container( return new Container(
padding: new EdgeDims.all(20.0), padding: new EdgeInsets.all(20.0),
child: new Column( child: new Column(
children: <Widget>[ children: <Widget>[
new Row( new Row(
children: <Widget>[ children: <Widget>[
new Text( new Text(
'${stock.symbol}', '${stock.symbol}',
style: Theme.of(context).text.display2 style: Theme.of(context).textTheme.display2
), ),
new Hero( new Hero(
key: new ObjectKey(stock), key: new ObjectKey(stock),
...@@ -66,7 +66,7 @@ class StockSymbolView extends StatelessComponent { ...@@ -66,7 +66,7 @@ class StockSymbolView extends StatelessComponent {
} }
} }
class StockSymbolPage extends StatelessComponent { class StockSymbolPage extends StatelessWidget {
StockSymbolPage({ this.stock }); StockSymbolPage({ this.stock });
final Stock stock; final Stock stock;
...@@ -79,7 +79,7 @@ class StockSymbolPage extends StatelessComponent { ...@@ -79,7 +79,7 @@ class StockSymbolPage extends StatelessComponent {
body: new Block( body: new Block(
children: <Widget>[ children: <Widget>[
new Container( new Container(
margin: new EdgeDims.all(20.0), margin: new EdgeInsets.all(20.0),
child: new Card(child: new StockSymbolView(stock: stock)) child: new Card(child: new StockSymbolView(stock: stock))
) )
] ]
...@@ -88,14 +88,14 @@ class StockSymbolPage extends StatelessComponent { ...@@ -88,14 +88,14 @@ class StockSymbolPage extends StatelessComponent {
} }
} }
class StockSymbolBottomSheet extends StatelessComponent { class StockSymbolBottomSheet extends StatelessWidget {
StockSymbolBottomSheet({ this.stock }); StockSymbolBottomSheet({ this.stock });
final Stock stock; final Stock stock;
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Container( return new Container(
padding: new EdgeDims.all(10.0), padding: new EdgeInsets.all(10.0),
decoration: new BoxDecoration( decoration: new BoxDecoration(
border: new Border(top: new BorderSide(color: Colors.black26, width: 1.0)) border: new Border(top: new BorderSide(color: Colors.black26, width: 1.0))
), ),
......
...@@ -16,7 +16,7 @@ export 'src/painting/basic_types.dart'; ...@@ -16,7 +16,7 @@ export 'src/painting/basic_types.dart';
export 'src/painting/box_painter.dart'; export 'src/painting/box_painter.dart';
export 'src/painting/colors.dart'; export 'src/painting/colors.dart';
export 'src/painting/decoration.dart'; export 'src/painting/decoration.dart';
export 'src/painting/edge_dims.dart'; export 'src/painting/edge_insets.dart';
export 'src/painting/text_editing.dart'; export 'src/painting/text_editing.dart';
export 'src/painting/text_painter.dart'; export 'src/painting/text_painter.dart';
export 'src/painting/text_style.dart'; export 'src/painting/text_style.dart';
......
...@@ -15,38 +15,38 @@ enum GestureDisposition { ...@@ -15,38 +15,38 @@ enum GestureDisposition {
/// ///
/// Receives callbacks from the GestureArena to notify the object when it wins /// Receives callbacks from the GestureArena to notify the object when it wins
/// or loses a gesture negotiation. Exactly one of [acceptGesture] or /// or loses a gesture negotiation. Exactly one of [acceptGesture] or
/// [rejectGesture] will be called for each arena key this member was added to, /// [rejectGesture] will be called for each arena this member was added to,
/// regardless of what caused the arena to be resolved. For example, if a /// regardless of what caused the arena to be resolved. For example, if a
/// member resolves the arena itself, that member still receives an /// member resolves the arena itself, that member still receives an
/// [acceptGesture] callback. /// [acceptGesture] callback.
abstract class GestureArenaMember { abstract class GestureArenaMember {
/// Called when this member wins the arena for the given key. /// Called when this member wins the arena for the given pointer id.
void acceptGesture(Object key); void acceptGesture(int pointer);
/// Called when this member loses the arena for the given key. /// Called when this member loses the arena for the given pointer id.
void rejectGesture(Object key); void rejectGesture(int pointer);
} }
/// An interface to information to an arena. /// An interface to information to an arena.
/// ///
/// A given [GestureArenaMember] can have multiple entries in multiple arenas /// A given [GestureArenaMember] can have multiple entries in multiple arenas
/// with different keys. /// with different pointer ids.
class GestureArenaEntry { class GestureArenaEntry {
GestureArenaEntry._(this._arena, this._key, this._member); GestureArenaEntry._(this._arena, this._pointer, this._member);
final GestureArena _arena; final GestureArenaManager _arena;
final Object _key; final int _pointer;
final GestureArenaMember _member; final GestureArenaMember _member;
/// Call this member to claim victory (with accepted) or admit defeat (with rejected). /// Call this member to claim victory (with accepted) or admit defeat (with rejected).
/// ///
/// It's fine to attempt to resolve an arena that is already resolved. /// It's fine to attempt to resolve an arena that is already resolved.
void resolve(GestureDisposition disposition) { void resolve(GestureDisposition disposition) {
_arena._resolve(_key, _member, disposition); _arena._resolve(_pointer, _member, disposition);
} }
} }
class _GestureArenaState { class _GestureArena {
final List<GestureArenaMember> members = new List<GestureArenaMember>(); final List<GestureArenaMember> members = new List<GestureArenaMember>();
bool isOpen = true; bool isOpen = true;
bool isHeld = false; bool isHeld = false;
...@@ -68,30 +68,30 @@ class _GestureArenaState { ...@@ -68,30 +68,30 @@ class _GestureArenaState {
/// ///
/// See [https://flutter.io/gestures/#gesture-disambiguation] for more /// See [https://flutter.io/gestures/#gesture-disambiguation] for more
/// information about the role this class plays in the gesture system. /// information about the role this class plays in the gesture system.
class GestureArena { class GestureArenaManager {
final Map<Object, _GestureArenaState> _arenas = new Map<Object, _GestureArenaState>(); final Map<int, _GestureArena> _arenas = new Map<int, _GestureArena>();
/// Adds a new member (e.g., gesture recognizer) to the arena. /// Adds a new member (e.g., gesture recognizer) to the arena.
GestureArenaEntry add(Object arenaKey, GestureArenaMember member) { GestureArenaEntry add(int pointer, GestureArenaMember member) {
_GestureArenaState state = _arenas.putIfAbsent(arenaKey, () => new _GestureArenaState()); _GestureArena state = _arenas.putIfAbsent(pointer, () => new _GestureArena());
state.add(member); state.add(member);
return new GestureArenaEntry._(this, arenaKey, member); return new GestureArenaEntry._(this, pointer, member);
} }
/// Prevents new members from entering the arena. /// Prevents new members from entering the arena.
/// ///
/// Called after the framework has finished dispatching the pointer down event. /// Called after the framework has finished dispatching the pointer down event.
void close(Object arenaKey) { void close(int pointer) {
_GestureArenaState state = _arenas[arenaKey]; _GestureArena state = _arenas[pointer];
if (state == null) if (state == null)
return; // This arena either never existed or has been resolved. return; // This arena either never existed or has been resolved.
state.isOpen = false; state.isOpen = false;
_tryToResolveArena(arenaKey, state); _tryToResolveArena(pointer, state);
} }
/// Forces resolution of the arena, giving the win to the first member. /// Forces resolution of the arena, giving the win to the first member.
void sweep(Object arenaKey) { void sweep(int pointer) {
_GestureArenaState state = _arenas[arenaKey]; _GestureArena state = _arenas[pointer];
if (state == null) if (state == null)
return; // This arena either never existed or has been resolved. return; // This arena either never existed or has been resolved.
assert(!state.isOpen); assert(!state.isOpen);
...@@ -99,19 +99,19 @@ class GestureArena { ...@@ -99,19 +99,19 @@ class GestureArena {
state.hasPendingSweep = true; state.hasPendingSweep = true;
return; // This arena is being held for a long-lived member return; // This arena is being held for a long-lived member
} }
_arenas.remove(arenaKey); _arenas.remove(pointer);
if (state.members.isNotEmpty) { if (state.members.isNotEmpty) {
// First member wins // First member wins
state.members.first.acceptGesture(arenaKey); state.members.first.acceptGesture(pointer);
// Give all the other members the bad news // Give all the other members the bad news
for (int i = 1; i < state.members.length; i++) for (int i = 1; i < state.members.length; i++)
state.members[i].rejectGesture(arenaKey); state.members[i].rejectGesture(pointer);
} }
} }
/// Prevents the arena from being swept. /// Prevents the arena from being swept.
void hold(Object key) { void hold(int pointer) {
_GestureArenaState state = _arenas[key]; _GestureArena state = _arenas[pointer];
if (state == null) if (state == null)
return; // This arena either never existed or has been resolved. return; // This arena either never existed or has been resolved.
state.isHeld = true; state.isHeld = true;
...@@ -121,58 +121,58 @@ class GestureArena { ...@@ -121,58 +121,58 @@ class GestureArena {
/// ///
/// If a sweep was attempted on a held arena, the sweep will be done /// If a sweep was attempted on a held arena, the sweep will be done
/// on release. /// on release.
void release(Object arenaKey) { void release(int pointer) {
_GestureArenaState state = _arenas[arenaKey]; _GestureArena state = _arenas[pointer];
if (state == null) if (state == null)
return; // This arena either never existed or has been resolved. return; // This arena either never existed or has been resolved.
state.isHeld = false; state.isHeld = false;
if (state.hasPendingSweep) if (state.hasPendingSweep)
sweep(arenaKey); sweep(pointer);
} }
void _tryToResolveArena(Object arenaKey, _GestureArenaState state) { void _tryToResolveArena(int pointer, _GestureArena state) {
assert(_arenas[arenaKey] == state); assert(_arenas[pointer] == state);
assert(!state.isOpen); assert(!state.isOpen);
if (state.members.length == 1) { if (state.members.length == 1) {
_arenas.remove(arenaKey); _arenas.remove(pointer);
state.members.first.acceptGesture(arenaKey); state.members.first.acceptGesture(pointer);
} else if (state.members.isEmpty) { } else if (state.members.isEmpty) {
_arenas.remove(arenaKey); _arenas.remove(pointer);
} else if (state.eagerWinner != null) { } else if (state.eagerWinner != null) {
_resolveInFavorOf(arenaKey, state, state.eagerWinner); _resolveInFavorOf(pointer, state, state.eagerWinner);
} }
} }
void _resolve(Object arenaKey, GestureArenaMember member, GestureDisposition disposition) { void _resolve(int pointer, GestureArenaMember member, GestureDisposition disposition) {
_GestureArenaState state = _arenas[arenaKey]; _GestureArena state = _arenas[pointer];
if (state == null) if (state == null)
return; // This arena has already resolved. return; // This arena has already resolved.
assert(state.members.contains(member)); assert(state.members.contains(member));
if (disposition == GestureDisposition.rejected) { if (disposition == GestureDisposition.rejected) {
state.members.remove(member); state.members.remove(member);
member.rejectGesture(arenaKey); member.rejectGesture(pointer);
if (!state.isOpen) if (!state.isOpen)
_tryToResolveArena(arenaKey, state); _tryToResolveArena(pointer, state);
} else { } else {
assert(disposition == GestureDisposition.accepted); assert(disposition == GestureDisposition.accepted);
if (state.isOpen) { if (state.isOpen) {
state.eagerWinner ??= member; state.eagerWinner ??= member;
} else { } else {
_resolveInFavorOf(arenaKey, state, member); _resolveInFavorOf(pointer, state, member);
} }
} }
} }
void _resolveInFavorOf(Object arenaKey, _GestureArenaState state, GestureArenaMember member) { void _resolveInFavorOf(int pointer, _GestureArena state, GestureArenaMember member) {
assert(state == _arenas[arenaKey]); assert(state == _arenas[pointer]);
assert(state != null); assert(state != null);
assert(state.eagerWinner == null || state.eagerWinner == member); assert(state.eagerWinner == null || state.eagerWinner == member);
assert(!state.isOpen); assert(!state.isOpen);
_arenas.remove(arenaKey); _arenas.remove(pointer);
for (GestureArenaMember rejectedMember in state.members) { for (GestureArenaMember rejectedMember in state.members) {
if (rejectedMember != member) if (rejectedMember != member)
rejectedMember.rejectGesture(arenaKey); rejectedMember.rejectGesture(pointer);
} }
member.acceptGesture(arenaKey); member.acceptGesture(pointer);
} }
} }
...@@ -48,7 +48,7 @@ abstract class Gesturer extends BindingBase implements HitTestTarget, HitTestabl ...@@ -48,7 +48,7 @@ abstract class Gesturer extends BindingBase implements HitTestTarget, HitTestabl
/// The gesture arenas used for disambiguating the meaning of sequences of /// The gesture arenas used for disambiguating the meaning of sequences of
/// pointer events. /// pointer events.
final GestureArena gestureArena = new GestureArena(); final GestureArenaManager gestureArena = new GestureArenaManager();
/// State for all pointers which are currently down. /// State for all pointers which are currently down.
/// ///
......
...@@ -31,7 +31,7 @@ abstract class GestureRecognizer extends GestureArenaMember { ...@@ -31,7 +31,7 @@ abstract class GestureRecognizer extends GestureArenaMember {
/// It's the GestureRecognizer's responsibility to then add itself /// It's the GestureRecognizer's responsibility to then add itself
/// to the global pointer router (see [PointerRouter]) to receive /// to the global pointer router (see [PointerRouter]) to receive
/// subsequent events for this pointer, and to add the pointer to /// subsequent events for this pointer, and to add the pointer to
/// the global gesture arena manager (see [GestureArena]) to track /// the global gesture arena manager (see [GestureArenaManager]) to track
/// that pointer. /// that pointer.
void addPointer(PointerDownEvent event); void addPointer(PointerDownEvent event);
......
...@@ -15,7 +15,7 @@ const double _kCloseProgressThreshold = 0.5; ...@@ -15,7 +15,7 @@ const double _kCloseProgressThreshold = 0.5;
const Color _kTransparent = const Color(0x00000000); const Color _kTransparent = const Color(0x00000000);
const Color _kBarrierColor = Colors.black54; const Color _kBarrierColor = Colors.black54;
class BottomSheet extends StatefulComponent { class BottomSheet extends StatefulWidget {
BottomSheet({ BottomSheet({
Key key, Key key,
this.animationController, this.animationController,
...@@ -94,7 +94,7 @@ class _BottomSheetState extends State<BottomSheet> { ...@@ -94,7 +94,7 @@ class _BottomSheetState extends State<BottomSheet> {
// MODAL BOTTOM SHEETS // MODAL BOTTOM SHEETS
class _ModalBottomSheetLayout extends OneChildLayoutDelegate { class _ModalBottomSheetLayout extends SingleChildLayoutDelegate {
_ModalBottomSheetLayout(this.progress); _ModalBottomSheetLayout(this.progress);
final double progress; final double progress;
...@@ -117,7 +117,7 @@ class _ModalBottomSheetLayout extends OneChildLayoutDelegate { ...@@ -117,7 +117,7 @@ class _ModalBottomSheetLayout extends OneChildLayoutDelegate {
} }
} }
class _ModalBottomSheet<T> extends StatefulComponent { class _ModalBottomSheet<T> extends StatefulWidget {
_ModalBottomSheet({ Key key, this.route }) : super(key: key); _ModalBottomSheet({ Key key, this.route }) : super(key: key);
final _ModalBottomSheetRoute<T> route; final _ModalBottomSheetRoute<T> route;
...@@ -133,7 +133,7 @@ class _ModalBottomSheetState<T> extends State<_ModalBottomSheet<T>> { ...@@ -133,7 +133,7 @@ class _ModalBottomSheetState<T> extends State<_ModalBottomSheet<T>> {
animation: config.route.animation, animation: config.route.animation,
builder: (BuildContext context, Widget child) { builder: (BuildContext context, Widget child) {
return new ClipRect( return new ClipRect(
child: new CustomOneChildLayout( child: new CustomSingleChildLayout(
delegate: new _ModalBottomSheetLayout(config.route.animation.value), delegate: new _ModalBottomSheetLayout(config.route.animation.value),
child: new BottomSheet( child: new BottomSheet(
animationController: config.route.animation, animationController: config.route.animation,
......
...@@ -39,7 +39,7 @@ class ButtonTheme extends InheritedWidget { ...@@ -39,7 +39,7 @@ class ButtonTheme extends InheritedWidget {
/// ///
/// MaterialButtons whose [onPressed] handler is null will be disabled. To have /// MaterialButtons whose [onPressed] handler is null will be disabled. To have
/// an enabled button, make sure to pass a non-null value for onPressed. /// an enabled button, make sure to pass a non-null value for onPressed.
abstract class MaterialButton extends StatefulComponent { abstract class MaterialButton extends StatefulWidget {
MaterialButton({ MaterialButton({
Key key, Key key,
this.child, this.child,
...@@ -116,14 +116,14 @@ abstract class MaterialButtonState<T extends MaterialButton> extends State<T> { ...@@ -116,14 +116,14 @@ abstract class MaterialButtonState<T extends MaterialButton> extends State<T> {
onTap: config.onPressed, onTap: config.onPressed,
onHighlightChanged: _handleHighlightChanged, onHighlightChanged: _handleHighlightChanged,
child: new Container( child: new Container(
padding: new EdgeDims.symmetric(horizontal: 8.0), padding: new EdgeInsets.symmetric(horizontal: 8.0),
child: new Center( child: new Center(
widthFactor: 1.0, widthFactor: 1.0,
child: config.child child: config.child
) )
) )
); );
TextStyle style = Theme.of(context).text.button.copyWith(color: getTextColor(context)); TextStyle style = Theme.of(context).textTheme.button.copyWith(color: getTextColor(context));
int elevation = this.elevation; int elevation = this.elevation;
Color color = getColor(context); Color color = getColor(context);
if (elevation > 0 || color != null) { if (elevation > 0 || color != null) {
...@@ -143,8 +143,8 @@ abstract class MaterialButtonState<T extends MaterialButton> extends State<T> { ...@@ -143,8 +143,8 @@ abstract class MaterialButtonState<T extends MaterialButton> extends State<T> {
return new Container( return new Container(
height: 36.0, height: 36.0,
constraints: new BoxConstraints(minWidth: 88.0), constraints: new BoxConstraints(minWidth: 88.0),
padding: const EdgeDims.symmetric(horizontal: 8.0), padding: const EdgeInsets.symmetric(horizontal: 8.0),
margin: const EdgeDims.all(8.0), margin: const EdgeInsets.all(8.0),
child: contents child: contents
); );
} }
......
...@@ -6,12 +6,12 @@ import 'package:flutter/widgets.dart'; ...@@ -6,12 +6,12 @@ import 'package:flutter/widgets.dart';
import 'material.dart'; import 'material.dart';
const EdgeDims _kCardMargins = const EdgeDims.all(4.0); const EdgeInsets _kCardMargins = const EdgeInsets.all(4.0);
/// A material design card /// A material design card
/// ///
/// <https://www.google.com/design/spec/components/cards.html> /// <https://www.google.com/design/spec/components/cards.html>
class Card extends StatelessComponent { class Card extends StatelessWidget {
const Card({ Key key, this.child, this.color }) : super(key: key); const Card({ Key key, this.child, this.color }) : super(key: key);
final Widget child; final Widget child;
......
...@@ -21,7 +21,7 @@ import 'toggleable.dart'; ...@@ -21,7 +21,7 @@ import 'toggleable.dart';
/// the checkbox. /// the checkbox.
/// ///
/// <https://www.google.com/design/spec/components/lists-controls.html#lists-controls-types-of-list-controls> /// <https://www.google.com/design/spec/components/lists-controls.html#lists-controls-types-of-list-controls>
class Checkbox extends StatelessComponent { class Checkbox extends StatelessWidget {
/// Constructs a checkbox /// Constructs a checkbox
/// ///
/// * `value` determines whether the checkbox is checked. /// * `value` determines whether the checkbox is checked.
......
...@@ -21,7 +21,7 @@ const TextStyle _kLabelStyle = const TextStyle( ...@@ -21,7 +21,7 @@ const TextStyle _kLabelStyle = const TextStyle(
textBaseline: TextBaseline.alphabetic textBaseline: TextBaseline.alphabetic
); );
class Chip extends StatelessComponent { class Chip extends StatelessWidget {
const Chip({ const Chip({
Key key, Key key,
this.avatar, this.avatar,
...@@ -45,7 +45,7 @@ class Chip extends StatelessComponent { ...@@ -45,7 +45,7 @@ class Chip extends StatelessComponent {
leftPadding = 0.0; leftPadding = 0.0;
children.add(new ExcludeSemantics( children.add(new ExcludeSemantics(
child: new Container( child: new Container(
margin: const EdgeDims.only(right: 8.0), margin: const EdgeInsets.only(right: 8.0),
width: _kAvatarDiamater, width: _kAvatarDiamater,
height: _kAvatarDiamater, height: _kAvatarDiamater,
child: avatar child: avatar
...@@ -65,7 +65,7 @@ class Chip extends StatelessComponent { ...@@ -65,7 +65,7 @@ class Chip extends StatelessComponent {
child: new Tooltip( child: new Tooltip(
message: 'Delete "$label"', message: 'Delete "$label"',
child: new Container( child: new Container(
padding: const EdgeDims.symmetric(horizontal: 4.0), padding: const EdgeInsets.symmetric(horizontal: 4.0),
child: new Icon( child: new Icon(
icon: Icons.cancel, icon: Icons.cancel,
size: 18.0, size: 18.0,
...@@ -80,7 +80,7 @@ class Chip extends StatelessComponent { ...@@ -80,7 +80,7 @@ class Chip extends StatelessComponent {
container: true, container: true,
child: new Container( child: new Container(
height: _kChipHeight, height: _kChipHeight,
padding: new EdgeDims.only(left: leftPadding, right: rightPadding), padding: new EdgeInsets.only(left: leftPadding, right: rightPadding),
decoration: new BoxDecoration( decoration: new BoxDecoration(
backgroundColor: Colors.grey[300], backgroundColor: Colors.grey[300],
borderRadius: 16.0 borderRadius: 16.0
......
...@@ -7,7 +7,7 @@ import 'package:flutter/widgets.dart'; ...@@ -7,7 +7,7 @@ import 'package:flutter/widgets.dart';
import 'constants.dart'; import 'constants.dart';
import 'theme.dart'; import 'theme.dart';
class CircleAvatar extends StatelessComponent { class CircleAvatar extends StatelessWidget {
CircleAvatar({ CircleAvatar({
Key key, Key key,
this.child, this.child,
......
...@@ -33,7 +33,7 @@ const double kFadingEdgeLength = 12.0; ...@@ -33,7 +33,7 @@ const double kFadingEdgeLength = 12.0;
const double kPressedStateDuration = 64.0; // units? const double kPressedStateDuration = 64.0; // units?
const Duration kThemeChangeDuration = const Duration(milliseconds: 200); const Duration kThemeChangeDuration = const Duration(milliseconds: 200);
const EdgeDims kDialogHeadingPadding = const EdgeDims.TRBL(24.0, 24.0, 20.0, 24.0); const EdgeInsets kDialogHeadingPadding = const EdgeInsets.TRBL(24.0, 24.0, 20.0, 24.0);
const double kRadialReactionRadius = 24.0; // Pixels const double kRadialReactionRadius = 24.0; // Pixels
const Duration kRadialReactionDuration = const Duration(milliseconds: 200); const Duration kRadialReactionDuration = const Duration(milliseconds: 200);
......
...@@ -17,7 +17,7 @@ import 'typography.dart'; ...@@ -17,7 +17,7 @@ import 'typography.dart';
enum _DatePickerMode { day, year } enum _DatePickerMode { day, year }
class DatePicker extends StatefulComponent { class DatePicker extends StatefulWidget {
DatePicker({ DatePicker({
this.selectedDate, this.selectedDate,
this.onChanged, this.onChanged,
...@@ -105,7 +105,7 @@ class _DatePickerState extends State<DatePicker> { ...@@ -105,7 +105,7 @@ class _DatePickerState extends State<DatePicker> {
} }
// Shows the selected date in large font and toggles between year and day mode // Shows the selected date in large font and toggles between year and day mode
class _DatePickerHeader extends StatelessComponent { class _DatePickerHeader extends StatelessWidget {
_DatePickerHeader({ this.selectedDate, this.mode, this.onModeChanged }) { _DatePickerHeader({ this.selectedDate, this.mode, this.onModeChanged }) {
assert(selectedDate != null); assert(selectedDate != null);
assert(mode != null); assert(mode != null);
...@@ -140,7 +140,7 @@ class _DatePickerHeader extends StatelessComponent { ...@@ -140,7 +140,7 @@ class _DatePickerHeader extends StatelessComponent {
TextStyle yearStyle = headerTheme.headline.copyWith(color: yearColor, height: 1.0); TextStyle yearStyle = headerTheme.headline.copyWith(color: yearColor, height: 1.0);
return new Container( return new Container(
padding: new EdgeDims.all(10.0), padding: new EdgeInsets.all(10.0),
decoration: new BoxDecoration(backgroundColor: theme.primaryColor), decoration: new BoxDecoration(backgroundColor: theme.primaryColor),
child: new Column( child: new Column(
children: <Widget>[ children: <Widget>[
...@@ -163,7 +163,7 @@ class _DatePickerHeader extends StatelessComponent { ...@@ -163,7 +163,7 @@ class _DatePickerHeader extends StatelessComponent {
} }
// Fixed height component shows a single month and allows choosing a day // Fixed height component shows a single month and allows choosing a day
class DayPicker extends StatelessComponent { class DayPicker extends StatelessWidget {
DayPicker({ DayPicker({
this.selectedDate, this.selectedDate,
this.currentDate, this.currentDate,
...@@ -183,7 +183,7 @@ class DayPicker extends StatelessComponent { ...@@ -183,7 +183,7 @@ class DayPicker extends StatelessComponent {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ThemeData themeData = Theme.of(context); ThemeData themeData = Theme.of(context);
TextStyle headerStyle = themeData.text.caption.copyWith(fontWeight: FontWeight.w700); TextStyle headerStyle = themeData.textTheme.caption.copyWith(fontWeight: FontWeight.w700);
TextStyle monthStyle = headerStyle.copyWith(fontSize: 14.0, height: 24.0 / 14.0); TextStyle monthStyle = headerStyle.copyWith(fontSize: 14.0, height: 24.0 / 14.0);
TextStyle dayStyle = headerStyle.copyWith(fontWeight: FontWeight.w500); TextStyle dayStyle = headerStyle.copyWith(fontWeight: FontWeight.w500);
DateFormat dateFormat = new DateFormat(); DateFormat dateFormat = new DateFormat();
...@@ -269,7 +269,7 @@ class DayPicker extends StatelessComponent { ...@@ -269,7 +269,7 @@ class DayPicker extends StatelessComponent {
} }
} }
class MonthPicker extends StatefulComponent { class MonthPicker extends StatefulWidget {
MonthPicker({ MonthPicker({
Key key, Key key,
this.selectedDate, this.selectedDate,
...@@ -351,7 +351,7 @@ class _MonthPickerState extends State<MonthPicker> { ...@@ -351,7 +351,7 @@ class _MonthPickerState extends State<MonthPicker> {
} }
// Scrollable list of years to allow picking a year // Scrollable list of years to allow picking a year
class YearPicker extends StatefulComponent { class YearPicker extends StatefulWidget {
YearPicker({ YearPicker({
Key key, Key key,
this.selectedDate, this.selectedDate,
...@@ -376,7 +376,7 @@ class _YearPickerState extends State<YearPicker> { ...@@ -376,7 +376,7 @@ class _YearPickerState extends State<YearPicker> {
static const double _itemExtent = 50.0; static const double _itemExtent = 50.0;
List<Widget> buildItems(BuildContext context, int start, int count) { List<Widget> buildItems(BuildContext context, int start, int count) {
TextStyle style = Theme.of(context).text.body1.copyWith(color: Colors.black54); TextStyle style = Theme.of(context).textTheme.body1.copyWith(color: Colors.black54);
List<Widget> items = new List<Widget>(); List<Widget> items = new List<Widget>();
for (int i = start; i < start + count; i++) { for (int i = start; i < start + count; i++) {
int year = config.firstDate.year + i; int year = config.firstDate.year + i;
......
...@@ -10,7 +10,7 @@ import 'dialog.dart'; ...@@ -10,7 +10,7 @@ import 'dialog.dart';
import 'date_picker.dart'; import 'date_picker.dart';
import 'flat_button.dart'; import 'flat_button.dart';
class _DatePickerDialog extends StatefulComponent { class _DatePickerDialog extends StatefulWidget {
_DatePickerDialog({ _DatePickerDialog({
Key key, Key key,
this.initialDate, this.initialDate,
...@@ -55,7 +55,7 @@ class _DatePickerDialogState extends State<_DatePickerDialog> { ...@@ -55,7 +55,7 @@ class _DatePickerDialogState extends State<_DatePickerDialog> {
lastDate: config.lastDate, lastDate: config.lastDate,
onChanged: _handleDateChanged onChanged: _handleDateChanged
), ),
contentPadding: EdgeDims.zero, contentPadding: EdgeInsets.zero,
actions: <Widget>[ actions: <Widget>[
new FlatButton( new FlatButton(
child: new Text('CANCEL'), child: new Text('CANCEL'),
......
...@@ -16,7 +16,7 @@ typedef Widget DialogBuilder(NavigatorState navigator); ...@@ -16,7 +16,7 @@ typedef Widget DialogBuilder(NavigatorState navigator);
/// A material design dialog /// A material design dialog
/// ///
/// <https://www.google.com/design/spec/components/dialogs.html> /// <https://www.google.com/design/spec/components/dialogs.html>
class Dialog extends StatelessComponent { class Dialog extends StatelessWidget {
Dialog({ Dialog({
Key key, Key key,
this.title, this.title,
...@@ -32,14 +32,14 @@ class Dialog extends StatelessComponent { ...@@ -32,14 +32,14 @@ class Dialog extends StatelessComponent {
// Padding around the title; uses material design default if none is supplied // Padding around the title; uses material design default if none is supplied
// If there is no title, no padding will be provided // If there is no title, no padding will be provided
final EdgeDims titlePadding; final EdgeInsets titlePadding;
/// The (optional) content of the dialog is displayed in the center of the /// The (optional) content of the dialog is displayed in the center of the
/// dialog in a lighter font. /// dialog in a lighter font.
final Widget content; final Widget content;
// Padding around the content; uses material design default if none is supplied // Padding around the content; uses material design default if none is supplied
final EdgeDims contentPadding; final EdgeInsets contentPadding;
/// The (optional) set of actions that are displayed at the bottom of the /// The (optional) set of actions that are displayed at the bottom of the
/// dialog. /// dialog.
...@@ -59,26 +59,26 @@ class Dialog extends StatelessComponent { ...@@ -59,26 +59,26 @@ class Dialog extends StatelessComponent {
List<Widget> dialogBody = new List<Widget>(); List<Widget> dialogBody = new List<Widget>();
if (title != null) { if (title != null) {
EdgeDims padding = titlePadding; EdgeInsets padding = titlePadding;
if (padding == null) if (padding == null)
padding = new EdgeDims.TRBL(24.0, 24.0, content == null ? 20.0 : 0.0, 24.0); padding = new EdgeInsets.TRBL(24.0, 24.0, content == null ? 20.0 : 0.0, 24.0);
dialogBody.add(new Padding( dialogBody.add(new Padding(
padding: padding, padding: padding,
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: Theme.of(context).text.title, style: Theme.of(context).textTheme.title,
child: title child: title
) )
)); ));
} }
if (content != null) { if (content != null) {
EdgeDims padding = contentPadding; EdgeInsets padding = contentPadding;
if (padding == null) if (padding == null)
padding = const EdgeDims.TRBL(20.0, 24.0, 24.0, 24.0); padding = const EdgeInsets.TRBL(20.0, 24.0, 24.0, 24.0);
dialogBody.add(new Padding( dialogBody.add(new Padding(
padding: padding, padding: padding,
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: Theme.of(context).text.subhead, style: Theme.of(context).textTheme.subhead,
child: content child: content
) )
)); ));
...@@ -98,7 +98,7 @@ class Dialog extends StatelessComponent { ...@@ -98,7 +98,7 @@ class Dialog extends StatelessComponent {
return new Center( return new Center(
child: new Container( child: new Container(
margin: new EdgeDims.symmetric(horizontal: 40.0, vertical: 24.0), margin: new EdgeInsets.symmetric(horizontal: 40.0, vertical: 24.0),
child: new ConstrainedBox( child: new ConstrainedBox(
constraints: new BoxConstraints(minWidth: 280.0), constraints: new BoxConstraints(minWidth: 280.0),
child: new Material( child: new Material(
......
...@@ -6,7 +6,7 @@ import 'package:flutter/widgets.dart'; ...@@ -6,7 +6,7 @@ import 'package:flutter/widgets.dart';
import 'theme.dart'; import 'theme.dart';
class Divider extends StatelessComponent { class Divider extends StatelessWidget {
Divider({ Key key, this.height: 16.0, this.indent: 0.0, this.color }) : super(key: key) { Divider({ Key key, this.height: 16.0, this.indent: 0.0, this.color }) : super(key: key) {
assert(height >= 1.0); assert(height >= 1.0);
} }
...@@ -19,7 +19,7 @@ class Divider extends StatelessComponent { ...@@ -19,7 +19,7 @@ class Divider extends StatelessComponent {
final double bottom = (height ~/ 2.0).toDouble(); final double bottom = (height ~/ 2.0).toDouble();
return new Container( return new Container(
height: 0.0, height: 0.0,
margin: new EdgeDims.only( margin: new EdgeInsets.only(
top: height - bottom - 1.0, top: height - bottom - 1.0,
left: indent, left: indent,
bottom: bottom bottom: bottom
......
...@@ -26,7 +26,7 @@ const double _kEdgeDragWidth = 20.0; ...@@ -26,7 +26,7 @@ const double _kEdgeDragWidth = 20.0;
const double _kMinFlingVelocity = 365.0; const double _kMinFlingVelocity = 365.0;
const Duration _kBaseSettleDuration = const Duration(milliseconds: 246); const Duration _kBaseSettleDuration = const Duration(milliseconds: 246);
class Drawer extends StatelessComponent { class Drawer extends StatelessWidget {
Drawer({ Drawer({
Key key, Key key,
this.elevation: 16, this.elevation: 16,
...@@ -47,7 +47,7 @@ class Drawer extends StatelessComponent { ...@@ -47,7 +47,7 @@ class Drawer extends StatelessComponent {
} }
} }
class DrawerController extends StatefulComponent { class DrawerController extends StatefulWidget {
DrawerController({ DrawerController({
GlobalKey key, GlobalKey key,
this.child this.child
......
...@@ -11,14 +11,14 @@ import 'theme.dart'; ...@@ -11,14 +11,14 @@ import 'theme.dart';
// TODO(jackson): This class should usually render the user's // TODO(jackson): This class should usually render the user's
// preferred banner image rather than a solid background // preferred banner image rather than a solid background
class DrawerHeader extends StatelessComponent { class DrawerHeader extends StatelessWidget {
const DrawerHeader({ Key key, this.child }) : super(key: key); const DrawerHeader({ Key key, this.child }) : super(key: key);
final Widget child; final Widget child;
Widget build(BuildContext context) { Widget build(BuildContext context) {
assert(debugCheckHasMaterial(context)); assert(debugCheckHasMaterial(context));
final double statusBarHeight = (MediaQuery.of(context)?.padding ?? EdgeDims.zero).top; final double statusBarHeight = (MediaQuery.of(context)?.padding ?? EdgeInsets.zero).top;
return new Container( return new Container(
height: statusBarHeight + kMaterialDrawerHeight, height: statusBarHeight + kMaterialDrawerHeight,
decoration: new BoxDecoration( decoration: new BoxDecoration(
...@@ -30,15 +30,15 @@ class DrawerHeader extends StatelessComponent { ...@@ -30,15 +30,15 @@ class DrawerHeader extends StatelessComponent {
) )
) )
), ),
padding: const EdgeDims.only(bottom: 7.0), padding: const EdgeInsets.only(bottom: 7.0),
margin: const EdgeDims.only(bottom: 8.0), margin: const EdgeInsets.only(bottom: 8.0),
child: new Column( child: new Column(
children: <Widget>[ children: <Widget>[
new Flexible(child: new Container()), new Flexible(child: new Container()),
new Container( new Container(
padding: const EdgeDims.symmetric(horizontal: 16.0), padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: Theme.of(context).text.body2, style: Theme.of(context).textTheme.body2,
child: child child: child
) )
) )
......
...@@ -11,7 +11,7 @@ import 'icons.dart'; ...@@ -11,7 +11,7 @@ import 'icons.dart';
import 'ink_well.dart'; import 'ink_well.dart';
import 'theme.dart'; import 'theme.dart';
class DrawerItem extends StatelessComponent { class DrawerItem extends StatelessWidget {
const DrawerItem({ const DrawerItem({
Key key, Key key,
this.icon, this.icon,
...@@ -43,7 +43,7 @@ class DrawerItem extends StatelessComponent { ...@@ -43,7 +43,7 @@ class DrawerItem extends StatelessComponent {
} }
TextStyle _getTextStyle(ThemeData themeData) { TextStyle _getTextStyle(ThemeData themeData) {
TextStyle result = themeData.text.body2; TextStyle result = themeData.textTheme.body2;
if (selected) { if (selected) {
switch (themeData.brightness) { switch (themeData.brightness) {
case ThemeBrightness.light: case ThemeBrightness.light:
...@@ -63,7 +63,7 @@ class DrawerItem extends StatelessComponent { ...@@ -63,7 +63,7 @@ class DrawerItem extends StatelessComponent {
if (icon != null) { if (icon != null) {
children.add( children.add(
new Padding( new Padding(
padding: const EdgeDims.symmetric(horizontal: 16.0), padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: new Icon( child: new Icon(
icon: icon, icon: icon,
color: _getIconColor(themeData) color: _getIconColor(themeData)
...@@ -74,7 +74,7 @@ class DrawerItem extends StatelessComponent { ...@@ -74,7 +74,7 @@ class DrawerItem extends StatelessComponent {
children.add( children.add(
new Flexible( new Flexible(
child: new Padding( child: new Padding(
padding: const EdgeDims.symmetric(horizontal: 16.0), padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: _getTextStyle(themeData), style: _getTextStyle(themeData),
child: child child: child
......
...@@ -16,7 +16,7 @@ import 'material.dart'; ...@@ -16,7 +16,7 @@ import 'material.dart';
const Duration _kDropDownMenuDuration = const Duration(milliseconds: 300); const Duration _kDropDownMenuDuration = const Duration(milliseconds: 300);
const double _kMenuItemHeight = 48.0; const double _kMenuItemHeight = 48.0;
const EdgeDims _kMenuHorizontalPadding = const EdgeDims.only(left: 36.0, right: 36.0); const EdgeInsets _kMenuHorizontalPadding = const EdgeInsets.only(left: 36.0, right: 36.0);
const double _kBaselineOffsetFromBottom = 20.0; const double _kBaselineOffsetFromBottom = 20.0;
const Border _kDropDownUnderline = const Border(bottom: const BorderSide(color: const Color(0xFFBDBDBD), width: 2.0)); const Border _kDropDownUnderline = const Border(bottom: const BorderSide(color: const Color(0xFFBDBDBD), width: 2.0));
...@@ -56,7 +56,7 @@ class _DropDownMenuPainter extends CustomPainter { ...@@ -56,7 +56,7 @@ class _DropDownMenuPainter extends CustomPainter {
} }
} }
class _DropDownMenu<T> extends StatusTransitionComponent { class _DropDownMenu<T> extends StatusTransitionWidget {
_DropDownMenu({ _DropDownMenu({
Key key, Key key,
_DropDownRoute<T> route _DropDownRoute<T> route
...@@ -197,7 +197,7 @@ class _DropDownRoute<T> extends PopupRoute<_DropDownRouteResult<T>> { ...@@ -197,7 +197,7 @@ class _DropDownRoute<T> extends PopupRoute<_DropDownRouteResult<T>> {
} }
} }
class DropDownMenuItem<T> extends StatelessComponent { class DropDownMenuItem<T> extends StatelessWidget {
DropDownMenuItem({ DropDownMenuItem({
Key key, Key key,
this.value, this.value,
...@@ -210,9 +210,9 @@ class DropDownMenuItem<T> extends StatelessComponent { ...@@ -210,9 +210,9 @@ class DropDownMenuItem<T> extends StatelessComponent {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Container( return new Container(
height: _kMenuItemHeight, height: _kMenuItemHeight,
padding: const EdgeDims.only(left: 8.0, right: 8.0, top: 6.0), padding: const EdgeInsets.only(left: 8.0, right: 8.0, top: 6.0),
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: Theme.of(context).text.subhead, style: Theme.of(context).textTheme.subhead,
child: new Baseline( child: new Baseline(
baseline: _kMenuItemHeight - _kBaselineOffsetFromBottom, baseline: _kMenuItemHeight - _kBaselineOffsetFromBottom,
child: child child: child
...@@ -222,7 +222,7 @@ class DropDownMenuItem<T> extends StatelessComponent { ...@@ -222,7 +222,7 @@ class DropDownMenuItem<T> extends StatelessComponent {
} }
} }
class DropDownButton<T> extends StatefulComponent { class DropDownButton<T> extends StatefulWidget {
DropDownButton({ DropDownButton({
Key key, Key key,
this.items, this.items,
...@@ -301,7 +301,7 @@ class _DropDownButtonState<T> extends State<DropDownButton<T>> { ...@@ -301,7 +301,7 @@ class _DropDownButtonState<T> extends State<DropDownButton<T>> {
), ),
new Container( new Container(
child: new Icon(icon: Icons.arrow_drop_down, size: 36.0), child: new Icon(icon: Icons.arrow_drop_down, size: 36.0),
padding: const EdgeDims.only(top: 6.0) padding: const EdgeInsets.only(top: 6.0)
) )
], ],
justifyContent: FlexJustifyContent.collapse justifyContent: FlexJustifyContent.collapse
......
...@@ -11,7 +11,7 @@ import 'constants.dart'; ...@@ -11,7 +11,7 @@ import 'constants.dart';
import 'scaffold.dart'; import 'scaffold.dart';
import 'theme.dart'; import 'theme.dart';
class FlexibleSpaceBar extends StatefulComponent { class FlexibleSpaceBar extends StatefulWidget {
FlexibleSpaceBar({ Key key, this.title, this.image }) : super(key: key); FlexibleSpaceBar({ Key key, this.title, this.image }) : super(key: key);
final Widget title; final Widget title;
...@@ -26,7 +26,7 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> { ...@@ -26,7 +26,7 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> {
assert(debugCheckHasScaffold(context)); assert(debugCheckHasScaffold(context));
final double appBarHeight = Scaffold.of(context).appBarHeight; final double appBarHeight = Scaffold.of(context).appBarHeight;
final Animation<double> animation = Scaffold.of(context).appBarAnimation; final Animation<double> animation = Scaffold.of(context).appBarAnimation;
final EdgeDims toolBarPadding = MediaQuery.of(context)?.padding ?? EdgeDims.zero; final EdgeInsets toolBarPadding = MediaQuery.of(context)?.padding ?? EdgeInsets.zero;
final double toolBarHeight = kToolBarHeight + toolBarPadding.top; final double toolBarHeight = kToolBarHeight + toolBarPadding.top;
final List<Widget> children = <Widget>[]; final List<Widget> children = <Widget>[];
...@@ -70,7 +70,7 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> { ...@@ -70,7 +70,7 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> {
curve: new Interval(0.0, scaleAndAlignEnd) curve: new Interval(0.0, scaleAndAlignEnd)
); );
children.add(new Padding( children.add(new Padding(
padding: const EdgeDims.only(left: 72.0, bottom: 14.0), padding: const EdgeInsets.only(left: 72.0, bottom: 14.0),
child: new Align( child: new Align(
alignment: new Tween<FractionalOffset>( alignment: new Tween<FractionalOffset>(
begin: new FractionalOffset(0.0, yAlignStart), begin: new FractionalOffset(0.0, yAlignStart),
......
...@@ -33,7 +33,7 @@ const Interval _kChildSegueInterval = const Interval(0.65, 1.0); ...@@ -33,7 +33,7 @@ const Interval _kChildSegueInterval = const Interval(0.65, 1.0);
/// ///
/// See also: /// See also:
/// * https://www.google.com/design/spec/components/buttons-floating-action-button.html /// * https://www.google.com/design/spec/components/buttons-floating-action-button.html
class FloatingActionButton extends StatefulComponent { class FloatingActionButton extends StatefulWidget {
const FloatingActionButton({ const FloatingActionButton({
Key key, Key key,
this.child, this.child,
......
...@@ -6,7 +6,7 @@ import 'package:flutter/widgets.dart'; ...@@ -6,7 +6,7 @@ import 'package:flutter/widgets.dart';
/// Creates a [Stack] with the header anchored across the top or a footer across the /// Creates a [Stack] with the header anchored across the top or a footer across the
/// bottom. The [GridTileBar] class can be used to create grid tile headers and footers. /// bottom. The [GridTileBar] class can be used to create grid tile headers and footers.
class GridTile extends StatelessComponent { class GridTile extends StatelessWidget {
GridTile({ Key key, this.header, this.footer, this.child }) : super(key: key) { GridTile({ Key key, this.header, this.footer, this.child }) : super(key: key) {
assert(child != null); assert(child != null);
} }
......
...@@ -15,7 +15,7 @@ import 'typography.dart'; ...@@ -15,7 +15,7 @@ import 'typography.dart';
/// https://www.google.com/design/spec/components/grid-lists.html#grid-lists-specs /// https://www.google.com/design/spec/components/grid-lists.html#grid-lists-specs
/// For a one-line header specify title and to add a second line specify caption. /// For a one-line header specify title and to add a second line specify caption.
/// Use left or right to add an icon. /// Use left or right to add an icon.
class GridTileBar extends StatelessComponent { class GridTileBar extends StatelessWidget {
GridTileBar({ Key key, this.backgroundColor, this.left, this.right, this.title, this.caption }) : super(key: key); GridTileBar({ Key key, this.backgroundColor, this.left, this.right, this.title, this.caption }) : super(key: key);
final Color backgroundColor; final Color backgroundColor;
...@@ -29,18 +29,18 @@ class GridTileBar extends StatelessComponent { ...@@ -29,18 +29,18 @@ class GridTileBar extends StatelessComponent {
if (backgroundColor != null) if (backgroundColor != null)
decoration = new BoxDecoration(backgroundColor: backgroundColor); decoration = new BoxDecoration(backgroundColor: backgroundColor);
EdgeDims padding; EdgeInsets padding;
if (left != null && right != null) if (left != null && right != null)
padding = const EdgeDims.symmetric(vertical: 16.0, horizontal: 8.0); padding = const EdgeInsets.symmetric(vertical: 16.0, horizontal: 8.0);
else if (left != null) else if (left != null)
padding = const EdgeDims.only(left: 8.0, right: 16.0, top: 16.0, bottom: 16.0); padding = const EdgeInsets.only(left: 8.0, right: 16.0, top: 16.0, bottom: 16.0);
else // right != null || (left == null && right == null) else // right != null || (left == null && right == null)
padding = const EdgeDims.only(left: 16.0, right: 8.0, top: 16.0, bottom: 16.0); padding = const EdgeInsets.only(left: 16.0, right: 8.0, top: 16.0, bottom: 16.0);
final List<Widget> children = <Widget>[]; final List<Widget> children = <Widget>[];
if (left != null) if (left != null)
children.add(new Padding(padding: const EdgeDims.only(right: 8.0), child: left)); children.add(new Padding(padding: const EdgeInsets.only(right: 8.0), child: left));
if (title != null && caption != null) { if (title != null && caption != null) {
children.add( children.add(
...@@ -72,7 +72,7 @@ class GridTileBar extends StatelessComponent { ...@@ -72,7 +72,7 @@ class GridTileBar extends StatelessComponent {
} }
if (right != null) if (right != null)
children.add(new Padding(padding: const EdgeDims.only(left: 8.0), child: right)); children.add(new Padding(padding: const EdgeInsets.only(left: 8.0), child: right));
return new Container( return new Container(
padding: padding, padding: padding,
......
...@@ -22,7 +22,7 @@ import 'theme.dart'; ...@@ -22,7 +22,7 @@ import 'theme.dart';
/// in your project's `flutter.yaml` file. This ensures that the /// in your project's `flutter.yaml` file. This ensures that the
/// MaterialIcons font is included in your application. This font is /// MaterialIcons font is included in your application. This font is
/// used to display the icons. /// used to display the icons.
class Icon extends StatelessComponent { class Icon extends StatelessWidget {
Icon({ Icon({
Key key, Key key,
this.icon, this.icon,
......
...@@ -20,7 +20,7 @@ import 'tooltip.dart'; ...@@ -20,7 +20,7 @@ import 'tooltip.dart';
/// ///
/// If the [onPressed] callback is not specified or null, then the button will /// If the [onPressed] callback is not specified or null, then the button will
/// be disabled, will not react to touch. /// be disabled, will not react to touch.
class IconButton extends StatelessComponent { class IconButton extends StatelessWidget {
const IconButton({ const IconButton({
Key key, Key key,
this.size: 24.0, this.size: 24.0,
...@@ -56,7 +56,7 @@ class IconButton extends StatelessComponent { ...@@ -56,7 +56,7 @@ class IconButton extends StatelessComponent {
Widget build(BuildContext context) { Widget build(BuildContext context) {
assert(debugCheckHasMaterial(context)); assert(debugCheckHasMaterial(context));
Widget result = new Padding( Widget result = new Padding(
padding: const EdgeDims.all(8.0), padding: const EdgeInsets.all(8.0),
child: new Icon( child: new Icon(
size: size, size: size,
icon: icon, icon: icon,
......
...@@ -24,7 +24,7 @@ import 'theme.dart'; ...@@ -24,7 +24,7 @@ import 'theme.dart';
/// at the top of its [build] function to call [debugCheckHasMaterial]: /// at the top of its [build] function to call [debugCheckHasMaterial]:
/// ///
/// assert(debugCheckHasMaterial(context)); /// assert(debugCheckHasMaterial(context));
class InkResponse extends StatefulComponent { class InkResponse extends StatefulWidget {
InkResponse({ InkResponse({
Key key, Key key,
this.child, this.child,
......
...@@ -14,7 +14,7 @@ import 'theme.dart'; ...@@ -14,7 +14,7 @@ import 'theme.dart';
export 'package:sky_services/editing/editing.mojom.dart' show KeyboardType; export 'package:sky_services/editing/editing.mojom.dart' show KeyboardType;
/// A material design text input field. /// A material design text input field.
class Input extends StatefulComponent { class Input extends StatefulWidget {
Input({ Input({
Key key, Key key,
this.value: InputValue.empty, this.value: InputValue.empty,
...@@ -84,7 +84,7 @@ class _InputState extends State<Input> { ...@@ -84,7 +84,7 @@ class _InputState extends State<Input> {
BuildContext focusContext = focusKey.currentContext; BuildContext focusContext = focusKey.currentContext;
bool focused = focusContext != null && Focus.at(focusContext, autofocus: config.autofocus); bool focused = focusContext != null && Focus.at(focusContext, autofocus: config.autofocus);
TextStyle textStyle = config.style ?? themeData.text.subhead; TextStyle textStyle = config.style ?? themeData.textTheme.subhead;
Color activeColor = themeData.hintColor; Color activeColor = themeData.hintColor;
if (focused) { if (focused) {
switch (themeData.brightness) { switch (themeData.brightness) {
...@@ -104,10 +104,10 @@ class _InputState extends State<Input> { ...@@ -104,10 +104,10 @@ class _InputState extends State<Input> {
if (config.labelText != null) { if (config.labelText != null) {
TextStyle labelStyle = hasInlineLabel ? TextStyle labelStyle = hasInlineLabel ?
themeData.text.subhead.copyWith(color: themeData.hintColor) : themeData.textTheme.subhead.copyWith(color: themeData.hintColor) :
themeData.text.caption.copyWith(color: activeColor); themeData.textTheme.caption.copyWith(color: activeColor);
double topPaddingIncrement = themeData.text.caption.fontSize + (config.isDense ? 4.0 : 8.0); double topPaddingIncrement = themeData.textTheme.caption.fontSize + (config.isDense ? 4.0 : 8.0);
double top = topPadding; double top = topPadding;
if (hasInlineLabel) if (hasInlineLabel)
top += topPaddingIncrement + textStyle.fontSize - labelStyle.fontSize; top += topPaddingIncrement + textStyle.fontSize - labelStyle.fontSize;
...@@ -124,7 +124,7 @@ class _InputState extends State<Input> { ...@@ -124,7 +124,7 @@ class _InputState extends State<Input> {
} }
if (config.hintText != null && config.value.text.isEmpty && !hasInlineLabel) { if (config.hintText != null && config.value.text.isEmpty && !hasInlineLabel) {
TextStyle hintStyle = themeData.text.subhead.copyWith(color: themeData.hintColor); TextStyle hintStyle = themeData.textTheme.subhead.copyWith(color: themeData.hintColor);
stackChildren.add(new Positioned( stackChildren.add(new Positioned(
left: 0.0, left: 0.0,
top: topPadding + textStyle.fontSize - hintStyle.fontSize, top: topPadding + textStyle.fontSize - hintStyle.fontSize,
...@@ -132,8 +132,8 @@ class _InputState extends State<Input> { ...@@ -132,8 +132,8 @@ class _InputState extends State<Input> {
)); ));
} }
EdgeDims margin = new EdgeDims.only(bottom: config.isDense ? 4.0 : 8.0); EdgeInsets margin = new EdgeInsets.only(bottom: config.isDense ? 4.0 : 8.0);
EdgeDims padding = new EdgeDims.only(top: topPadding, bottom: 8.0); EdgeInsets padding = new EdgeInsets.only(top: topPadding, bottom: 8.0);
Color borderColor = activeColor; Color borderColor = activeColor;
double borderWidth = focused ? 2.0 : 1.0; double borderWidth = focused ? 2.0 : 1.0;
...@@ -141,8 +141,8 @@ class _InputState extends State<Input> { ...@@ -141,8 +141,8 @@ class _InputState extends State<Input> {
borderColor = themeData.errorColor; borderColor = themeData.errorColor;
borderWidth = 2.0; borderWidth = 2.0;
if (!config.isDense) { if (!config.isDense) {
margin = const EdgeDims.only(bottom: 15.0); margin = const EdgeInsets.only(bottom: 15.0);
padding = new EdgeDims.only(top: topPadding, bottom: 1.0); padding = new EdgeInsets.only(top: topPadding, bottom: 1.0);
} }
} }
...@@ -174,7 +174,7 @@ class _InputState extends State<Input> { ...@@ -174,7 +174,7 @@ class _InputState extends State<Input> {
)); ));
if (config.errorText != null && !config.isDense) { if (config.errorText != null && !config.isDense) {
TextStyle errorStyle = themeData.text.caption.copyWith(color: themeData.errorColor); TextStyle errorStyle = themeData.textTheme.caption.copyWith(color: themeData.errorColor);
stackChildren.add(new Positioned( stackChildren.add(new Positioned(
left: 0.0, left: 0.0,
bottom: 0.0, bottom: 0.0,
...@@ -191,7 +191,7 @@ class _InputState extends State<Input> { ...@@ -191,7 +191,7 @@ class _InputState extends State<Input> {
alignItems: FlexAlignItems.start, alignItems: FlexAlignItems.start,
children: [ children: [
new Container( new Container(
margin: new EdgeDims.only(right: 16.0, top: iconTop), margin: new EdgeInsets.only(right: 16.0, top: iconTop),
width: config.isDense ? 40.0 : 48.0, width: config.isDense ? 40.0 : 48.0,
child: new Icon( child: new Icon(
icon: config.icon, icon: config.icon,
...@@ -208,7 +208,7 @@ class _InputState extends State<Input> { ...@@ -208,7 +208,7 @@ class _InputState extends State<Input> {
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () => _rawInputLineKey.currentState?.requestKeyboard(), onTap: () => _rawInputLineKey.currentState?.requestKeyboard(),
child: new Padding( child: new Padding(
padding: const EdgeDims.symmetric(horizontal: 16.0), padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: child child: child
) )
); );
......
...@@ -21,14 +21,14 @@ Map<MaterialListType, double> kListItemExtent = const <MaterialListType, double> ...@@ -21,14 +21,14 @@ Map<MaterialListType, double> kListItemExtent = const <MaterialListType, double>
MaterialListType.threeLine: kThreeLineListItemHeight, MaterialListType.threeLine: kThreeLineListItemHeight,
}; };
class MaterialList extends StatefulComponent { class MaterialList extends StatefulWidget {
MaterialList({ MaterialList({
Key key, Key key,
this.initialScrollOffset, this.initialScrollOffset,
this.onScroll, this.onScroll,
this.type: MaterialListType.twoLine, this.type: MaterialListType.twoLine,
this.children, this.children,
this.scrollablePadding: EdgeDims.zero, this.scrollablePadding: EdgeInsets.zero,
this.scrollableKey this.scrollableKey
}) : super(key: key); }) : super(key: key);
...@@ -36,7 +36,7 @@ class MaterialList extends StatefulComponent { ...@@ -36,7 +36,7 @@ class MaterialList extends StatefulComponent {
final ScrollListener onScroll; final ScrollListener onScroll;
final MaterialListType type; final MaterialListType type;
final Iterable<Widget> children; final Iterable<Widget> children;
final EdgeDims scrollablePadding; final EdgeInsets scrollablePadding;
final Key scrollableKey; final Key scrollableKey;
_MaterialListState createState() => new _MaterialListState(); _MaterialListState createState() => new _MaterialListState();
...@@ -52,7 +52,7 @@ class _MaterialListState extends State<MaterialList> { ...@@ -52,7 +52,7 @@ class _MaterialListState extends State<MaterialList> {
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
onScroll: config.onScroll, onScroll: config.onScroll,
itemExtent: kListItemExtent[config.type], itemExtent: kListItemExtent[config.type],
padding: const EdgeDims.symmetric(vertical: 8.0) + config.scrollablePadding, padding: const EdgeInsets.symmetric(vertical: 8.0) + config.scrollablePadding,
scrollableListPainter: _scrollbarPainter, scrollableListPainter: _scrollbarPainter,
children: config.children children: config.children
); );
......
...@@ -15,7 +15,7 @@ import 'theme.dart'; ...@@ -15,7 +15,7 @@ import 'theme.dart';
/// isThreeLine: true is specified. If dense: true is specified then the overall /// isThreeLine: true is specified. If dense: true is specified then the overall
/// height of this list item and the size of the DefaultTextStyles that wrap /// height of this list item and the size of the DefaultTextStyles that wrap
/// the [primary] and [secondary] widget are reduced. /// the [primary] and [secondary] widget are reduced.
class ListItem extends StatelessComponent { class ListItem extends StatelessWidget {
ListItem({ ListItem({
Key key, Key key,
this.left, this.left,
...@@ -69,7 +69,7 @@ class ListItem extends StatelessComponent { ...@@ -69,7 +69,7 @@ class ListItem extends StatelessComponent {
TextStyle primaryTextStyle(BuildContext context) { TextStyle primaryTextStyle(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final TextStyle style = theme.text.subhead; final TextStyle style = theme.textTheme.subhead;
if (!enabled) { if (!enabled) {
final Color color = theme.disabledColor; final Color color = theme.disabledColor;
return dense ? style.copyWith(fontSize: 13.0, color: color) : style.copyWith(color: color); return dense ? style.copyWith(fontSize: 13.0, color: color) : style.copyWith(color: color);
...@@ -79,8 +79,8 @@ class ListItem extends StatelessComponent { ...@@ -79,8 +79,8 @@ class ListItem extends StatelessComponent {
TextStyle secondaryTextStyle(BuildContext context) { TextStyle secondaryTextStyle(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final Color color = theme.text.caption.color; final Color color = theme.textTheme.caption.color;
final TextStyle style = theme.text.body1; final TextStyle style = theme.textTheme.body1;
return dense ? style.copyWith(color: color, fontSize: 12.0) : style.copyWith(color: color); return dense ? style.copyWith(color: color, fontSize: 12.0) : style.copyWith(color: color);
} }
...@@ -105,7 +105,7 @@ class ListItem extends StatelessComponent { ...@@ -105,7 +105,7 @@ class ListItem extends StatelessComponent {
if (left != null) { if (left != null) {
children.add(new Container( children.add(new Container(
margin: new EdgeDims.only(right: 16.0, top: iconMarginTop), margin: new EdgeInsets.only(right: 16.0, top: iconMarginTop),
width: 40.0, width: 40.0,
child: new Align( child: new Align(
alignment: new FractionalOffset(0.0, isThreeLine ? 0.0 : 0.5), alignment: new FractionalOffset(0.0, isThreeLine ? 0.0 : 0.5),
...@@ -138,7 +138,7 @@ class ListItem extends StatelessComponent { ...@@ -138,7 +138,7 @@ class ListItem extends StatelessComponent {
if (right != null) { if (right != null) {
children.add(new Container( children.add(new Container(
margin: new EdgeDims.only(left: 16.0, top: iconMarginTop), margin: new EdgeInsets.only(left: 16.0, top: iconMarginTop),
child: new Align( child: new Align(
alignment: new FractionalOffset(1.0, isThreeLine ? 0.0 : 0.5), alignment: new FractionalOffset(1.0, isThreeLine ? 0.0 : 0.5),
child: right child: right
...@@ -151,7 +151,7 @@ class ListItem extends StatelessComponent { ...@@ -151,7 +151,7 @@ class ListItem extends StatelessComponent {
onLongPress: enabled ? onLongPress : null, onLongPress: enabled ? onLongPress : null,
child: new Container( child: new Container(
height: itemHeight, height: itemHeight,
padding: const EdgeDims.symmetric(horizontal: 16.0), padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: new Row( child: new Row(
alignItems: FlexAlignItems.center, alignItems: FlexAlignItems.center,
children: children children: children
......
...@@ -73,7 +73,7 @@ abstract class MaterialInkController { ...@@ -73,7 +73,7 @@ abstract class MaterialInkController {
/// list on the paper, and it's been scrolled), a LayoutChangedNotification must /// list on the paper, and it's been scrolled), a LayoutChangedNotification must
/// be dispatched at the relevant subtree. (This in particular means that /// be dispatched at the relevant subtree. (This in particular means that
/// Transitions should not be placed inside Material.) /// Transitions should not be placed inside Material.)
class Material extends StatefulComponent { class Material extends StatefulWidget {
Material({ Material({
Key key, Key key,
this.child, this.child,
...@@ -130,7 +130,7 @@ class _MaterialState extends State<Material> { ...@@ -130,7 +130,7 @@ class _MaterialState extends State<Material> {
Widget contents = config.child; Widget contents = config.child;
if (contents != null) { if (contents != null) {
contents = new DefaultTextStyle( contents = new DefaultTextStyle(
style: config.textStyle ?? Theme.of(context).text.body1, style: config.textStyle ?? Theme.of(context).textTheme.body1,
child: contents child: contents
); );
} }
...@@ -274,7 +274,7 @@ class RenderInkFeatures extends RenderProxyBox implements MaterialInkController ...@@ -274,7 +274,7 @@ class RenderInkFeatures extends RenderProxyBox implements MaterialInkController
} }
} }
class InkFeatures extends OneChildRenderObjectWidget { class InkFeatures extends SingleChildRenderObjectWidget {
InkFeatures({ Key key, this.color, Widget child }) : super(key: key, child: child); InkFeatures({ Key key, this.color, Widget child }) : super(key: key, child: child);
final Color color; final Color color;
......
...@@ -6,7 +6,7 @@ import 'dart:async'; ...@@ -6,7 +6,7 @@ import 'dart:async';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
class _MaterialPageTransition extends AnimatedComponent { class _MaterialPageTransition extends AnimatedWidget {
_MaterialPageTransition({ _MaterialPageTransition({
Key key, Key key,
Animation<double> animation, Animation<double> animation,
......
...@@ -28,7 +28,7 @@ const double _kMenuVerticalPadding = 8.0; ...@@ -28,7 +28,7 @@ const double _kMenuVerticalPadding = 8.0;
const double _kMenuWidthStep = 56.0; const double _kMenuWidthStep = 56.0;
const double _kMenuScreenPadding = 8.0; const double _kMenuScreenPadding = 8.0;
abstract class PopupMenuEntry<T> extends StatefulComponent { abstract class PopupMenuEntry<T> extends StatefulWidget {
PopupMenuEntry({ Key key }) : super(key: key); PopupMenuEntry({ Key key }) : super(key: key);
double get height; double get height;
...@@ -75,7 +75,7 @@ class _PopupMenuItemState<T extends PopupMenuItem<dynamic>> extends State<T> { ...@@ -75,7 +75,7 @@ class _PopupMenuItemState<T extends PopupMenuItem<dynamic>> extends State<T> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
TextStyle style = theme.text.subhead; TextStyle style = theme.textTheme.subhead;
if (!config.enabled) if (!config.enabled)
style = style.copyWith(color: theme.disabledColor); style = style.copyWith(color: theme.disabledColor);
...@@ -99,7 +99,7 @@ class _PopupMenuItemState<T extends PopupMenuItem<dynamic>> extends State<T> { ...@@ -99,7 +99,7 @@ class _PopupMenuItemState<T extends PopupMenuItem<dynamic>> extends State<T> {
child: new MergeSemantics( child: new MergeSemantics(
child: new Container( child: new Container(
height: config.height, height: config.height,
padding: const EdgeDims.symmetric(horizontal: _kMenuHorizontalPadding), padding: const EdgeInsets.symmetric(horizontal: _kMenuHorizontalPadding),
child: item child: item
) )
) )
...@@ -159,7 +159,7 @@ class _CheckedPopupMenuItemState<T> extends _PopupMenuItemState<CheckedPopupMenu ...@@ -159,7 +159,7 @@ class _CheckedPopupMenuItemState<T> extends _PopupMenuItemState<CheckedPopupMenu
} }
} }
class _PopupMenu<T> extends StatelessComponent { class _PopupMenu<T> extends StatelessWidget {
_PopupMenu({ _PopupMenu({
Key key, Key key,
this.route this.route
...@@ -204,7 +204,7 @@ class _PopupMenu<T> extends StatelessComponent { ...@@ -204,7 +204,7 @@ class _PopupMenu<T> extends StatelessComponent {
stepWidth: _kMenuWidthStep, stepWidth: _kMenuWidthStep,
child: new Block( child: new Block(
children: children, children: children,
padding: const EdgeDims.symmetric( padding: const EdgeInsets.symmetric(
vertical: _kMenuVerticalPadding vertical: _kMenuVerticalPadding
) )
) )
...@@ -233,7 +233,7 @@ class _PopupMenu<T> extends StatelessComponent { ...@@ -233,7 +233,7 @@ class _PopupMenu<T> extends StatelessComponent {
} }
} }
class _PopupMenuRouteLayout extends OneChildLayoutDelegate { class _PopupMenuRouteLayout extends SingleChildLayoutDelegate {
_PopupMenuRouteLayout(this.position, this.selectedItemOffset); _PopupMenuRouteLayout(this.position, this.selectedItemOffset);
final ModalPosition position; final ModalPosition position;
...@@ -316,7 +316,7 @@ class _PopupMenuRoute<T> extends PopupRoute<T> { ...@@ -316,7 +316,7 @@ class _PopupMenuRoute<T> extends PopupRoute<T> {
final Size screenSize = MediaQuery.of(context).size; final Size screenSize = MediaQuery.of(context).size;
return new ConstrainedBox( return new ConstrainedBox(
constraints: new BoxConstraints(maxWidth: screenSize.width, maxHeight: screenSize.height), constraints: new BoxConstraints(maxWidth: screenSize.width, maxHeight: screenSize.height),
child: new CustomOneChildLayout( child: new CustomSingleChildLayout(
delegate: new _PopupMenuRouteLayout(position, selectedItemOffset), delegate: new _PopupMenuRouteLayout(position, selectedItemOffset),
child: new _PopupMenu<T>(route: this) child: new _PopupMenu<T>(route: this)
) )
...@@ -357,7 +357,7 @@ typedef void PopupMenuItemSelected<T>(T value); ...@@ -357,7 +357,7 @@ typedef void PopupMenuItemSelected<T>(T value);
/// because an item was selected. The value passed to [onSelected] is the value of /// because an item was selected. The value passed to [onSelected] is the value of
/// the selected menu item. If child is null then a standard 'navigation/more_vert' /// the selected menu item. If child is null then a standard 'navigation/more_vert'
/// icon is created. /// icon is created.
class PopupMenuButton<T> extends StatefulComponent { class PopupMenuButton<T> extends StatefulWidget {
PopupMenuButton({ PopupMenuButton({
Key key, Key key,
this.items, this.items,
......
...@@ -14,7 +14,7 @@ const double _kCircularProgressIndicatorStrokeWidth = 4.0; ...@@ -14,7 +14,7 @@ const double _kCircularProgressIndicatorStrokeWidth = 4.0;
// TODO(hansmuller): implement the support for buffer indicator // TODO(hansmuller): implement the support for buffer indicator
abstract class ProgressIndicator extends StatefulComponent { abstract class ProgressIndicator extends StatefulWidget {
ProgressIndicator({ ProgressIndicator({
Key key, Key key,
this.value this.value
......
...@@ -14,7 +14,7 @@ const double _kDiameter = 16.0; ...@@ -14,7 +14,7 @@ const double _kDiameter = 16.0;
const double _kOuterRadius = _kDiameter / 2.0; const double _kOuterRadius = _kDiameter / 2.0;
const double _kInnerRadius = 5.0; const double _kInnerRadius = 5.0;
class Radio<T> extends StatelessComponent { class Radio<T> extends StatelessWidget {
Radio({ Radio({
Key key, Key key,
this.value, this.value,
......
...@@ -37,7 +37,7 @@ enum _ScaffoldSlot { ...@@ -37,7 +37,7 @@ enum _ScaffoldSlot {
class _ScaffoldLayout extends MultiChildLayoutDelegate { class _ScaffoldLayout extends MultiChildLayoutDelegate {
_ScaffoldLayout({ this.padding }); _ScaffoldLayout({ this.padding });
final EdgeDims padding; final EdgeInsets padding;
void performLayout(Size size) { void performLayout(Size size) {
BoxConstraints looseConstraints = new BoxConstraints.loose(size); BoxConstraints looseConstraints = new BoxConstraints.loose(size);
...@@ -51,12 +51,12 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate { ...@@ -51,12 +51,12 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate {
double contentTop = padding.top; double contentTop = padding.top;
double contentBottom = size.height - padding.bottom; double contentBottom = size.height - padding.bottom;
if (isChild(_ScaffoldSlot.toolBar)) { if (hasChild(_ScaffoldSlot.toolBar)) {
contentTop = layoutChild(_ScaffoldSlot.toolBar, fullWidthConstraints).height; contentTop = layoutChild(_ScaffoldSlot.toolBar, fullWidthConstraints).height;
positionChild(_ScaffoldSlot.toolBar, Offset.zero); positionChild(_ScaffoldSlot.toolBar, Offset.zero);
} }
if (isChild(_ScaffoldSlot.body)) { if (hasChild(_ScaffoldSlot.body)) {
final double bodyHeight = contentBottom - contentTop; final double bodyHeight = contentBottom - contentTop;
final BoxConstraints bodyConstraints = fullWidthConstraints.tighten(height: bodyHeight); final BoxConstraints bodyConstraints = fullWidthConstraints.tighten(height: bodyHeight);
layoutChild(_ScaffoldSlot.body, bodyConstraints); layoutChild(_ScaffoldSlot.body, bodyConstraints);
...@@ -75,17 +75,17 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate { ...@@ -75,17 +75,17 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate {
Size bottomSheetSize = Size.zero; Size bottomSheetSize = Size.zero;
Size snackBarSize = Size.zero; Size snackBarSize = Size.zero;
if (isChild(_ScaffoldSlot.bottomSheet)) { if (hasChild(_ScaffoldSlot.bottomSheet)) {
bottomSheetSize = layoutChild(_ScaffoldSlot.bottomSheet, fullWidthConstraints); bottomSheetSize = layoutChild(_ScaffoldSlot.bottomSheet, fullWidthConstraints);
positionChild(_ScaffoldSlot.bottomSheet, new Offset((size.width - bottomSheetSize.width) / 2.0, contentBottom - bottomSheetSize.height)); positionChild(_ScaffoldSlot.bottomSheet, new Offset((size.width - bottomSheetSize.width) / 2.0, contentBottom - bottomSheetSize.height));
} }
if (isChild(_ScaffoldSlot.snackBar)) { if (hasChild(_ScaffoldSlot.snackBar)) {
snackBarSize = layoutChild(_ScaffoldSlot.snackBar, fullWidthConstraints); snackBarSize = layoutChild(_ScaffoldSlot.snackBar, fullWidthConstraints);
positionChild(_ScaffoldSlot.snackBar, new Offset(0.0, contentBottom - snackBarSize.height)); positionChild(_ScaffoldSlot.snackBar, new Offset(0.0, contentBottom - snackBarSize.height));
} }
if (isChild(_ScaffoldSlot.floatingActionButton)) { if (hasChild(_ScaffoldSlot.floatingActionButton)) {
final Size fabSize = layoutChild(_ScaffoldSlot.floatingActionButton, looseConstraints); final Size fabSize = layoutChild(_ScaffoldSlot.floatingActionButton, looseConstraints);
final double fabX = size.width - fabSize.width - _kFloatingActionButtonMargin; final double fabX = size.width - fabSize.width - _kFloatingActionButtonMargin;
double fabY = contentBottom - fabSize.height - _kFloatingActionButtonMargin; double fabY = contentBottom - fabSize.height - _kFloatingActionButtonMargin;
...@@ -96,7 +96,7 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate { ...@@ -96,7 +96,7 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate {
positionChild(_ScaffoldSlot.floatingActionButton, new Offset(fabX, fabY)); positionChild(_ScaffoldSlot.floatingActionButton, new Offset(fabX, fabY));
} }
if (isChild(_ScaffoldSlot.drawer)) { if (hasChild(_ScaffoldSlot.drawer)) {
layoutChild(_ScaffoldSlot.drawer, new BoxConstraints.tight(size)); layoutChild(_ScaffoldSlot.drawer, new BoxConstraints.tight(size));
positionChild(_ScaffoldSlot.drawer, Offset.zero); positionChild(_ScaffoldSlot.drawer, Offset.zero);
} }
...@@ -107,7 +107,7 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate { ...@@ -107,7 +107,7 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate {
} }
} }
class _FloatingActionButtonTransition extends StatefulComponent { class _FloatingActionButtonTransition extends StatefulWidget {
_FloatingActionButtonTransition({ _FloatingActionButtonTransition({
Key key, Key key,
this.child this.child
...@@ -180,7 +180,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr ...@@ -180,7 +180,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr
/// This class provides APIs for showing drawers, snackbars, and bottom sheets. /// This class provides APIs for showing drawers, snackbars, and bottom sheets.
/// ///
/// See: <https://www.google.com/design/spec/layout/structure.html> /// See: <https://www.google.com/design/spec/layout/structure.html>
class Scaffold extends StatefulComponent { class Scaffold extends StatefulWidget {
Scaffold({ Scaffold({
Key key, Key key,
this.toolBar, this.toolBar,
...@@ -375,11 +375,11 @@ class ScaffoldState extends State<Scaffold> { ...@@ -375,11 +375,11 @@ class ScaffoldState extends State<Scaffold> {
bool _shouldShowBackArrow; bool _shouldShowBackArrow;
Widget _getModifiedToolBar({ EdgeDims padding, double foregroundOpacity: 1.0, int elevation }) { Widget _getModifiedToolBar({ EdgeInsets padding, double foregroundOpacity: 1.0, int elevation }) {
ToolBar toolBar = config.toolBar; ToolBar toolBar = config.toolBar;
if (toolBar == null) if (toolBar == null)
return null; return null;
EdgeDims toolBarPadding = new EdgeDims.only(top: padding.top); EdgeInsets toolBarPadding = new EdgeInsets.only(top: padding.top);
Widget left = toolBar.left; Widget left = toolBar.left;
if (left == null) { if (left == null) {
if (config.drawer != null) { if (config.drawer != null) {
...@@ -431,7 +431,7 @@ class ScaffoldState extends State<Scaffold> { ...@@ -431,7 +431,7 @@ class ScaffoldState extends State<Scaffold> {
} }
Widget _buildScrollableAppBar(BuildContext context) { Widget _buildScrollableAppBar(BuildContext context) {
final EdgeDims toolBarPadding = MediaQuery.of(context)?.padding ?? EdgeDims.zero; final EdgeInsets toolBarPadding = MediaQuery.of(context)?.padding ?? EdgeInsets.zero;
final double toolBarHeight = kToolBarHeight + toolBarPadding.top; final double toolBarHeight = kToolBarHeight + toolBarPadding.top;
Widget appBar; Widget appBar;
...@@ -468,7 +468,7 @@ class ScaffoldState extends State<Scaffold> { ...@@ -468,7 +468,7 @@ class ScaffoldState extends State<Scaffold> {
} }
Widget build(BuildContext context) { Widget build(BuildContext context) {
EdgeDims padding = MediaQuery.of(context)?.padding ?? EdgeDims.zero; EdgeInsets padding = MediaQuery.of(context)?.padding ?? EdgeInsets.zero;
if (_snackBars.length > 0) { if (_snackBars.length > 0) {
ModalRoute<dynamic> route = ModalRoute.of(context); ModalRoute<dynamic> route = ModalRoute.of(context);
...@@ -538,7 +538,7 @@ class ScaffoldState extends State<Scaffold> { ...@@ -538,7 +538,7 @@ class ScaffoldState extends State<Scaffold> {
new CustomMultiChildLayout( new CustomMultiChildLayout(
children: children, children: children,
delegate: new _ScaffoldLayout( delegate: new _ScaffoldLayout(
padding: EdgeDims.zero padding: EdgeInsets.zero
) )
), ),
new Positioned( new Positioned(
...@@ -572,7 +572,7 @@ class ScaffoldFeatureController<T extends Widget, U> { ...@@ -572,7 +572,7 @@ class ScaffoldFeatureController<T extends Widget, U> {
final StateSetter setState; final StateSetter setState;
} }
class _PersistentBottomSheet extends StatefulComponent { class _PersistentBottomSheet extends StatefulWidget {
_PersistentBottomSheet({ _PersistentBottomSheet({
Key key, Key key,
this.animationController, this.animationController,
......
...@@ -7,7 +7,7 @@ import 'dart:ui' show Color, Offset; ...@@ -7,7 +7,7 @@ import 'dart:ui' show Color, Offset;
import 'package:flutter/painting.dart'; import 'package:flutter/painting.dart';
// Based on http://www.google.com/design/spec/what-is-material/elevation-shadows.html // Based on http://www.google.com/design/spec/what-is-material/elevation-shadows.html
// Currently, only the elevation values that are bound to one or more components are // Currently, only the elevation values that are bound to one or more widgets are
// defined here. // defined here.
/// Map of elevation offsets used by material design to [BoxShadow] definitions. /// Map of elevation offsets used by material design to [BoxShadow] definitions.
......
...@@ -11,7 +11,7 @@ import 'constants.dart'; ...@@ -11,7 +11,7 @@ import 'constants.dart';
import 'debug.dart'; import 'debug.dart';
import 'theme.dart'; import 'theme.dart';
class Slider extends StatelessComponent { class Slider extends StatelessWidget {
Slider({ Slider({
Key key, Key key,
this.value, this.value,
......
...@@ -37,7 +37,7 @@ const Curve _snackBarFadeCurve = const Interval(0.72, 1.0, curve: Curves.fastOut ...@@ -37,7 +37,7 @@ const Curve _snackBarFadeCurve = const Interval(0.72, 1.0, curve: Curves.fastOut
/// ///
/// See also: /// See also:
/// * https://www.google.com/design/spec/components/snackbars-toasts.html /// * https://www.google.com/design/spec/components/snackbars-toasts.html
class SnackBarAction extends StatelessComponent { class SnackBarAction extends StatelessWidget {
SnackBarAction({Key key, this.label, this.onPressed }) : super(key: key) { SnackBarAction({Key key, this.label, this.onPressed }) : super(key: key) {
assert(label != null); assert(label != null);
assert(onPressed != null); assert(onPressed != null);
...@@ -51,7 +51,7 @@ class SnackBarAction extends StatelessComponent { ...@@ -51,7 +51,7 @@ class SnackBarAction extends StatelessComponent {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Container( return new Container(
margin: const EdgeDims.only(left: _kSideMargins), margin: const EdgeInsets.only(left: _kSideMargins),
child: new FlatButton( child: new FlatButton(
onPressed: onPressed, onPressed: onPressed,
textTheme: ButtonColor.accent, textTheme: ButtonColor.accent,
...@@ -70,7 +70,7 @@ class SnackBarAction extends StatelessComponent { ...@@ -70,7 +70,7 @@ class SnackBarAction extends StatelessComponent {
/// * [Scaffold.of] and [ScaffoldState.showSnackBar] /// * [Scaffold.of] and [ScaffoldState.showSnackBar]
/// * [SnackBarAction] /// * [SnackBarAction]
/// * https://www.google.com/design/spec/components/snackbars-toasts.html /// * https://www.google.com/design/spec/components/snackbars-toasts.html
class SnackBar extends StatelessComponent { class SnackBar extends StatelessWidget {
SnackBar({ SnackBar({
Key key, Key key,
this.content, this.content,
...@@ -91,7 +91,7 @@ class SnackBar extends StatelessComponent { ...@@ -91,7 +91,7 @@ class SnackBar extends StatelessComponent {
List<Widget> children = <Widget>[ List<Widget> children = <Widget>[
new Flexible( new Flexible(
child: new Container( child: new Container(
margin: const EdgeDims.symmetric(vertical: _kSingleLineVerticalPadding), margin: const EdgeInsets.symmetric(vertical: _kSingleLineVerticalPadding),
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: Typography.white.subhead, style: Typography.white.subhead,
child: content child: content
...@@ -120,13 +120,13 @@ class SnackBar extends StatelessComponent { ...@@ -120,13 +120,13 @@ class SnackBar extends StatelessComponent {
elevation: 6, elevation: 6,
color: _kSnackBackground, color: _kSnackBackground,
child: new Container( child: new Container(
margin: const EdgeDims.symmetric(horizontal: _kSideMargins), margin: const EdgeInsets.symmetric(horizontal: _kSideMargins),
child: new Theme( child: new Theme(
data: new ThemeData( data: new ThemeData(
brightness: ThemeBrightness.dark, brightness: ThemeBrightness.dark,
accentColor: theme.accentColor, accentColor: theme.accentColor,
accentColorBrightness: theme.accentColorBrightness, accentColorBrightness: theme.accentColorBrightness,
text: Typography.white textTheme: Typography.white
), ),
child: new FadeTransition( child: new FadeTransition(
opacity: fadeAnimation, opacity: fadeAnimation,
......
...@@ -13,7 +13,7 @@ import 'shadows.dart'; ...@@ -13,7 +13,7 @@ import 'shadows.dart';
import 'theme.dart'; import 'theme.dart';
import 'toggleable.dart'; import 'toggleable.dart';
class Switch extends StatelessComponent { class Switch extends StatelessWidget {
Switch({ Key key, this.value, this.activeColor, this.onChanged }) Switch({ Key key, this.value, this.activeColor, this.onChanged })
: super(key: key); : super(key: key);
......
...@@ -28,7 +28,7 @@ const double _kTextAndIconTabHeight = 72.0; ...@@ -28,7 +28,7 @@ const double _kTextAndIconTabHeight = 72.0;
const double _kTabIndicatorHeight = 2.0; const double _kTabIndicatorHeight = 2.0;
const double _kMinTabWidth = 72.0; const double _kMinTabWidth = 72.0;
const double _kMaxTabWidth = 264.0; const double _kMaxTabWidth = 264.0;
const EdgeDims _kTabLabelPadding = const EdgeDims.symmetric(horizontal: 12.0); const EdgeInsets _kTabLabelPadding = const EdgeInsets.symmetric(horizontal: 12.0);
const double _kTabBarScrollDrag = 0.025; const double _kTabBarScrollDrag = 0.025;
const Duration _kTabBarScroll = const Duration(milliseconds: 300); const Duration _kTabBarScroll = const Duration(milliseconds: 300);
...@@ -297,7 +297,7 @@ class TabLabel { ...@@ -297,7 +297,7 @@ class TabLabel {
final TabLabelIconBuilder iconBuilder; final TabLabelIconBuilder iconBuilder;
} }
class _Tab extends StatelessComponent { class _Tab extends StatelessWidget {
_Tab({ _Tab({
Key key, Key key,
this.onSelected, this.onSelected,
...@@ -342,7 +342,7 @@ class _Tab extends StatelessComponent { ...@@ -342,7 +342,7 @@ class _Tab extends StatelessComponent {
children: <Widget>[ children: <Widget>[
new Container( new Container(
child: _buildLabelIcon(context), child: _buildLabelIcon(context),
margin: const EdgeDims.only(bottom: 10.0) margin: const EdgeInsets.only(bottom: 10.0)
), ),
_buildLabelText() _buildLabelText()
], ],
...@@ -374,7 +374,7 @@ class _TabsScrollBehavior extends BoundedBehavior { ...@@ -374,7 +374,7 @@ class _TabsScrollBehavior extends BoundedBehavior {
bool isScrollable = true; bool isScrollable = true;
Simulation createFlingScrollSimulation(double position, double velocity) { Simulation createScrollSimulation(double position, double velocity) {
if (!isScrollable) if (!isScrollable)
return null; return null;
...@@ -395,7 +395,7 @@ abstract class TabBarSelectionAnimationListener { ...@@ -395,7 +395,7 @@ abstract class TabBarSelectionAnimationListener {
void handleSelectionDeactivate(); void handleSelectionDeactivate();
} }
class TabBarSelection<T> extends StatefulComponent { class TabBarSelection<T> extends StatefulWidget {
TabBarSelection({ TabBarSelection({
Key key, Key key,
this.value, this.value,
...@@ -784,7 +784,7 @@ class _TabBarState<T> extends ScrollableState<TabBar<T>> implements TabBarSelect ...@@ -784,7 +784,7 @@ class _TabBarState<T> extends ScrollableState<TabBar<T>> implements TabBarSelect
if (config.isScrollable) { if (config.isScrollable) {
return new Viewport( return new Viewport(
scrollDirection: Axis.horizontal, mainAxis: Axis.horizontal,
paintOffset: scrollOffsetToPixelDelta(scrollOffset), paintOffset: scrollOffsetToPixelDelta(scrollOffset),
onPaintOffsetUpdateNeeded: _handlePaintOffsetUpdateNeeded, onPaintOffsetUpdateNeeded: _handlePaintOffsetUpdateNeeded,
child: contents child: contents
...@@ -961,7 +961,7 @@ class _TabBarViewState<T> extends PageableListState<TabBarView<T>> implements Ta ...@@ -961,7 +961,7 @@ class _TabBarViewState<T> extends PageableListState<TabBarView<T>> implements Ta
_initSelection(newSelection); _initSelection(newSelection);
return new PageViewport( return new PageViewport(
itemsWrap: config.itemsWrap, itemsWrap: config.itemsWrap,
scrollDirection: config.scrollDirection, mainAxis: config.scrollDirection,
startOffset: scrollOffset, startOffset: scrollOffset,
overlayPainter: config.scrollableListPainter, overlayPainter: config.scrollableListPainter,
children: _items children: _items
...@@ -969,7 +969,7 @@ class _TabBarViewState<T> extends PageableListState<TabBarView<T>> implements Ta ...@@ -969,7 +969,7 @@ class _TabBarViewState<T> extends PageableListState<TabBarView<T>> implements Ta
} }
} }
class TabPageSelector<T> extends StatelessComponent { class TabPageSelector<T> extends StatelessWidget {
const TabPageSelector({ Key key }) : super(key: key); const TabPageSelector({ Key key }) : super(key: key);
Widget _buildTabIndicator(TabBarSelectionState<T> selection, T tab, Animation<double> animation, ColorTween selectedColor, ColorTween previousColor) { Widget _buildTabIndicator(TabBarSelectionState<T> selection, T tab, Animation<double> animation, ColorTween selectedColor, ColorTween previousColor) {
...@@ -988,7 +988,7 @@ class TabPageSelector<T> extends StatelessComponent { ...@@ -988,7 +988,7 @@ class TabPageSelector<T> extends StatelessComponent {
return new Container( return new Container(
width: 12.0, width: 12.0,
height: 12.0, height: 12.0,
margin: new EdgeDims.all(4.0), margin: new EdgeInsets.all(4.0),
decoration: new BoxDecoration( decoration: new BoxDecoration(
backgroundColor: background, backgroundColor: background,
border: new Border.all(color: selectedColor.end), border: new Border.all(color: selectedColor.end),
......
...@@ -52,7 +52,7 @@ class ThemeData { ...@@ -52,7 +52,7 @@ class ThemeData {
Color hintColor, Color hintColor,
double hintOpacity, double hintOpacity,
Color errorColor, Color errorColor,
TextTheme text, TextTheme textTheme,
TextTheme primaryTextTheme, TextTheme primaryTextTheme,
IconThemeData primaryIconTheme IconThemeData primaryIconTheme
}) { }) {
...@@ -77,7 +77,7 @@ class ThemeData { ...@@ -77,7 +77,7 @@ class ThemeData {
hintColor ??= isDark ? const Color(0x42FFFFFF) : const Color(0x4C000000); hintColor ??= isDark ? const Color(0x42FFFFFF) : const Color(0x4C000000);
hintOpacity ??= hintColor != null ? hintColor.alpha / 0xFF : isDark ? 0.26 : 0.30; hintOpacity ??= hintColor != null ? hintColor.alpha / 0xFF : isDark ? 0.26 : 0.30;
errorColor ??= Colors.red[700]; errorColor ??= Colors.red[700];
text ??= isDark ? Typography.white : Typography.black; textTheme ??= isDark ? Typography.white : Typography.black;
primaryTextTheme ??= primaryColorBrightness == ThemeBrightness.dark ? Typography.white : Typography.black; primaryTextTheme ??= primaryColorBrightness == ThemeBrightness.dark ? Typography.white : Typography.black;
primaryIconTheme ??= primaryColorBrightness == ThemeBrightness.dark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black); primaryIconTheme ??= primaryColorBrightness == ThemeBrightness.dark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black);
return new ThemeData.raw( return new ThemeData.raw(
...@@ -100,7 +100,7 @@ class ThemeData { ...@@ -100,7 +100,7 @@ class ThemeData {
hintColor: hintColor, hintColor: hintColor,
hintOpacity: hintOpacity, hintOpacity: hintOpacity,
errorColor: errorColor, errorColor: errorColor,
text: text, textTheme: textTheme,
primaryTextTheme: primaryTextTheme, primaryTextTheme: primaryTextTheme,
primaryIconTheme: primaryIconTheme primaryIconTheme: primaryIconTheme
); );
...@@ -126,7 +126,7 @@ class ThemeData { ...@@ -126,7 +126,7 @@ class ThemeData {
this.hintColor, this.hintColor,
this.hintOpacity, this.hintOpacity,
this.errorColor, this.errorColor,
this.text, this.textTheme,
this.primaryTextTheme, this.primaryTextTheme,
this.primaryIconTheme this.primaryIconTheme
}) { }) {
...@@ -149,7 +149,7 @@ class ThemeData { ...@@ -149,7 +149,7 @@ class ThemeData {
assert(hintColor != null); assert(hintColor != null);
assert(hintOpacity != null); assert(hintOpacity != null);
assert(errorColor != null); assert(errorColor != null);
assert(text != null); assert(textTheme != null);
assert(primaryTextTheme != null); assert(primaryTextTheme != null);
assert(primaryIconTheme != null); assert(primaryIconTheme != null);
} }
...@@ -207,7 +207,7 @@ class ThemeData { ...@@ -207,7 +207,7 @@ class ThemeData {
final Color errorColor; final Color errorColor;
/// Text with a color that contrasts with the card and canvas colors. /// Text with a color that contrasts with the card and canvas colors.
final TextTheme text; final TextTheme textTheme;
/// A text theme that contrasts with the primary color. /// A text theme that contrasts with the primary color.
final TextTheme primaryTextTheme; final TextTheme primaryTextTheme;
...@@ -235,7 +235,7 @@ class ThemeData { ...@@ -235,7 +235,7 @@ class ThemeData {
hintColor: Color.lerp(begin.hintColor, end.hintColor, t), hintColor: Color.lerp(begin.hintColor, end.hintColor, t),
hintOpacity: lerpDouble(begin.hintOpacity, end.hintOpacity, t), hintOpacity: lerpDouble(begin.hintOpacity, end.hintOpacity, t),
errorColor: Color.lerp(begin.errorColor, end.errorColor, t), errorColor: Color.lerp(begin.errorColor, end.errorColor, t),
text: TextTheme.lerp(begin.text, end.text, t), textTheme: TextTheme.lerp(begin.textTheme, end.textTheme, t),
primaryTextTheme: TextTheme.lerp(begin.primaryTextTheme, end.primaryTextTheme, t), primaryTextTheme: TextTheme.lerp(begin.primaryTextTheme, end.primaryTextTheme, t),
primaryIconTheme: IconThemeData.lerp(begin.primaryIconTheme, end.primaryIconTheme, t) primaryIconTheme: IconThemeData.lerp(begin.primaryIconTheme, end.primaryIconTheme, t)
); );
...@@ -264,7 +264,7 @@ class ThemeData { ...@@ -264,7 +264,7 @@ class ThemeData {
(otherData.hintColor == hintColor) && (otherData.hintColor == hintColor) &&
(otherData.hintOpacity == hintOpacity) && (otherData.hintOpacity == hintOpacity) &&
(otherData.errorColor == errorColor) && (otherData.errorColor == errorColor) &&
(otherData.text == text) && (otherData.textTheme == textTheme) &&
(otherData.primaryTextTheme == primaryTextTheme) && (otherData.primaryTextTheme == primaryTextTheme) &&
(otherData.primaryIconTheme == primaryIconTheme); (otherData.primaryIconTheme == primaryIconTheme);
} }
...@@ -290,7 +290,7 @@ class ThemeData { ...@@ -290,7 +290,7 @@ class ThemeData {
hintColor, hintColor,
hintOpacity, hintOpacity,
errorColor, errorColor,
text, textTheme,
primaryTextTheme, primaryTextTheme,
primaryIconTheme primaryIconTheme
) )
......
...@@ -89,7 +89,7 @@ class TimeOfDay { ...@@ -89,7 +89,7 @@ class TimeOfDay {
enum _TimePickerMode { hour, minute } enum _TimePickerMode { hour, minute }
class TimePicker extends StatefulComponent { class TimePicker extends StatefulWidget {
TimePicker({ TimePicker({
this.selectedTime, this.selectedTime,
this.onChanged this.onChanged
...@@ -126,7 +126,7 @@ class _TimePickerState extends State<TimePicker> { ...@@ -126,7 +126,7 @@ class _TimePickerState extends State<TimePicker> {
new AspectRatio( new AspectRatio(
aspectRatio: 1.0, aspectRatio: 1.0,
child: new Container( child: new Container(
margin: const EdgeDims.all(12.0), margin: const EdgeInsets.all(12.0),
child: new _Dial( child: new _Dial(
mode: _mode, mode: _mode,
selectedTime: config.selectedTime, selectedTime: config.selectedTime,
...@@ -141,7 +141,7 @@ class _TimePickerState extends State<TimePicker> { ...@@ -141,7 +141,7 @@ class _TimePickerState extends State<TimePicker> {
} }
// TODO(ianh): Localize! // TODO(ianh): Localize!
class _TimePickerHeader extends StatelessComponent { class _TimePickerHeader extends StatelessWidget {
_TimePickerHeader({ _TimePickerHeader({
this.selectedTime, this.selectedTime,
this.mode, this.mode,
...@@ -214,12 +214,12 @@ class _TimePickerHeader extends StatelessComponent { ...@@ -214,12 +214,12 @@ class _TimePickerHeader extends StatelessComponent {
onTap: _handleChangeDayPeriod, onTap: _handleChangeDayPeriod,
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
child: new Container( child: new Container(
padding: const EdgeDims.only(left: 16.0, right: 24.0), padding: const EdgeInsets.only(left: 16.0, right: 24.0),
child: new Column( child: new Column(
children: <Widget>[ children: <Widget>[
new Text('AM', style: amStyle), new Text('AM', style: amStyle),
new Container( new Container(
padding: const EdgeDims.only(top: 4.0), padding: const EdgeInsets.only(top: 4.0),
child: new Text('PM', style: pmStyle) child: new Text('PM', style: pmStyle)
), ),
], ],
...@@ -312,7 +312,7 @@ class _DialPainter extends CustomPainter { ...@@ -312,7 +312,7 @@ class _DialPainter extends CustomPainter {
} }
} }
class _Dial extends StatefulComponent { class _Dial extends StatefulWidget {
_Dial({ _Dial({
this.selectedTime, this.selectedTime,
this.mode, this.mode,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment