Give the CustomPaint and SizeObserver callbacks better names

The style we use for callbacks in widgets is "onFoo". These classes were using
an order naming convention and just called their callbacks "callback".
This commit is contained in:
Adam Barth
2015-10-19 17:22:59 -07:00
parent 2edc6dbb3d
commit 529fa95f87
21 changed files with 60 additions and 60 deletions

View File

@@ -159,7 +159,7 @@ class TextureButtonState extends State<TextureButton> {
width: config.width,
height: config.height,
child: new CustomPaint(
callback: paintCallback,
onPaint: paintCallback,
token: new _TextureButtonToken(
_highlight,
config.texture,

View File

@@ -37,7 +37,7 @@ RenderBox getBox(double lh) {
padding: new EdgeDims.all(10.0),
child: new RenderCustomPaint(
child: paragraph,
callback: (canvas, size) {
onPaint: (canvas, size) {
double baseline = paragraph.getDistanceToBaseline(TextBaseline.alphabetic);
double w = paragraph.getMaxIntrinsicWidth(new BoxConstraints.loose(size));
double h = paragraph.getMaxIntrinsicHeight(new BoxConstraints.loose(size));

View File

@@ -25,7 +25,7 @@ class StockArrow extends StatelessComponent {
// TODO(jackson): This should change colors with the theme
Color color = _colorForPercentChange(percentChange);
const double kSize = 40.0;
var arrow = new CustomPaint(callback: (ui.Canvas canvas, Size size) {
var arrow = new CustomPaint(onPaint: (ui.Canvas canvas, Size size) {
Paint paint = new Paint()..color = color;
paint.strokeWidth = 1.0;
const double padding = 2.0;

View File

@@ -337,7 +337,7 @@ class CardCollectionState extends State<CardCollection> {
]);
Widget body = new SizeObserver(
callback: _updateCardCollectionSize,
onSizeChanged: _updateCardCollectionSize,
child: new Container(
padding: const EdgeDims.symmetric(vertical: 12.0, horizontal: 8.0),
decoration: new BoxDecoration(backgroundColor: Theme.of(context).primarySwatch[50]),

View File

@@ -58,7 +58,7 @@ class Marker extends StatelessComponent {
child: new Container(
width: size,
height: size,
child: new CustomPaint(callback: paintMarker)
child: new CustomPaint(onPaint: paintMarker)
)
)
);

View File

@@ -136,7 +136,7 @@ class PageableListAppState extends State<PageableListApp> {
: pageSize.width
);
return new SizeObserver(
callback: updatePageSize,
onSizeChanged: updatePageSize,
child: list
);
}

View File

@@ -63,7 +63,7 @@ class ScaleAppState extends State<ScaleApp> {
body: new GestureDetector(
onScaleStart: _handleScaleStart,
onScaleUpdate: _handleScaleUpdate,
child: new CustomPaint(callback: paint, token: "$_zoom $_offset")
child: new CustomPaint(onPaint: paint, token: "$_zoom $_offset")
)
)
);