Clean up imports and exports.
Each layer is supposed to reexport the parts of the previous layer that are part of its API. - In painting.dart, export from dart:ui all the Canvas-related APIs that make sense to be used at higher levels, e.g. PaintingStyle. - Delete painting/shadows.dart. It was dead code. - In rendering/object.dart, export all of painting.dart. - In widgets/basic.dart, export all of painting.dart and animation.dart. Some classes in animation/ are renamed to make this less disruptive and confusing to the namespace. - Split out Stocks back into an import model rather than a part model, so that it's easier to manage its dependencies on a per-file basis. - Move Ticker to scheduler library. - Remove as many redundant imports as possible now. - Some minor nit picking cleanup in various files.
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/rendering.dart';
|
||||
|
||||
class _BaselinePainter extends CustomPainter {
|
||||
@@ -29,7 +27,7 @@ class _BaselinePainter extends CustomPainter {
|
||||
path.lineTo(w, h);
|
||||
paint = new Paint()
|
||||
..color = const Color(0xFFFF9000)
|
||||
..style = ui.PaintingStyle.stroke
|
||||
..style = PaintingStyle.stroke
|
||||
..strokeWidth = 1.5;
|
||||
canvas.drawPath(path, paint);
|
||||
|
||||
@@ -39,7 +37,7 @@ class _BaselinePainter extends CustomPainter {
|
||||
path.lineTo(w, baseline);
|
||||
paint = new Paint()
|
||||
..color = const Color(0xFF00FF90)
|
||||
..style = ui.PaintingStyle.stroke
|
||||
..style = PaintingStyle.stroke
|
||||
..strokeWidth = 1.5;
|
||||
canvas.drawPath(path, paint);
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/rendering.dart';
|
||||
|
||||
void main() {
|
||||
@@ -15,7 +13,7 @@ void main() {
|
||||
additionalConstraints: new BoxConstraints.tightFor(height: 100.0),
|
||||
child: new RenderDecoratedBox(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: new ui.Color(0xFFFFFF00)
|
||||
backgroundColor: const Color(0xFFFFFF00)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -27,12 +25,12 @@ void main() {
|
||||
child: new RenderDecoratedBox(
|
||||
decoration: new BoxDecoration(
|
||||
border: new Border(
|
||||
top: new BorderSide(color: new ui.Color(0xFFF00000), width: 5.0),
|
||||
right: new BorderSide(color: new ui.Color(0xFFFF9000), width: 10.0),
|
||||
bottom: new BorderSide(color: new ui.Color(0xFFFFF000), width: 15.0),
|
||||
left: new BorderSide(color: new ui.Color(0xFF00FF00), width: 20.0)
|
||||
top: new BorderSide(color: const Color(0xFFF00000), width: 5.0),
|
||||
right: new BorderSide(color: const Color(0xFFFF9000), width: 10.0),
|
||||
bottom: new BorderSide(color: const Color(0xFFFFF000), width: 15.0),
|
||||
left: new BorderSide(color: const Color(0xFF00FF00), width: 20.0)
|
||||
),
|
||||
backgroundColor: new ui.Color(0xFFDDDDDD)
|
||||
backgroundColor: const Color(0xFFDDDDDD)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -43,7 +41,7 @@ void main() {
|
||||
additionalConstraints: new BoxConstraints.tightFor(height: 100.0),
|
||||
child: new RenderDecoratedBox(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: new ui.Color(0xFFFFFF00)
|
||||
backgroundColor: const Color(0xFFFFFF00)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -54,7 +52,7 @@ void main() {
|
||||
additionalConstraints: new BoxConstraints.tightFor(height: 100.0),
|
||||
child: new RenderDecoratedBox(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: new ui.Color(0xFFFFFF00)
|
||||
backgroundColor: const Color(0xFFFFFF00)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -65,7 +63,7 @@ void main() {
|
||||
additionalConstraints: new BoxConstraints.tightFor(height: 100.0),
|
||||
child: new RenderDecoratedBox(
|
||||
decoration: new BoxDecoration(
|
||||
backgroundColor: new ui.Color(0xFFFFFF00)
|
||||
backgroundColor: const Color(0xFFFFFF00)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'lib/solid_color_box.dart';
|
||||
|
||||
@@ -11,11 +9,11 @@ RenderBox buildFlexExample() {
|
||||
RenderFlex flexRoot = new RenderFlex(direction: FlexDirection.vertical);
|
||||
|
||||
RenderDecoratedBox root = new RenderDecoratedBox(
|
||||
decoration: new BoxDecoration(backgroundColor: const ui.Color(0xFF000000)),
|
||||
decoration: new BoxDecoration(backgroundColor: const Color(0xFF000000)),
|
||||
child: flexRoot
|
||||
);
|
||||
|
||||
void addFlexChildSolidColor(RenderFlex parent, ui.Color backgroundColor, { int flex: 0 }) {
|
||||
void addFlexChildSolidColor(RenderFlex parent, Color backgroundColor, { int flex: 0 }) {
|
||||
RenderSolidColorBox child = new RenderSolidColorBox(backgroundColor);
|
||||
parent.add(child);
|
||||
final FlexParentData childParentData = child.parentData;
|
||||
@@ -23,13 +21,13 @@ RenderBox buildFlexExample() {
|
||||
}
|
||||
|
||||
// Yellow bar at top
|
||||
addFlexChildSolidColor(flexRoot, const ui.Color(0xFFFFFF00), flex: 1);
|
||||
addFlexChildSolidColor(flexRoot, const Color(0xFFFFFF00), flex: 1);
|
||||
|
||||
// Turquoise box
|
||||
flexRoot.add(new RenderSolidColorBox(const ui.Color(0x7700FFFF), desiredSize: new ui.Size(100.0, 100.0)));
|
||||
flexRoot.add(new RenderSolidColorBox(const Color(0x7700FFFF), desiredSize: new Size(100.0, 100.0)));
|
||||
|
||||
var renderDecoratedBlock = new RenderDecoratedBox(
|
||||
decoration: new BoxDecoration(backgroundColor: const ui.Color(0xFFFFFFFF))
|
||||
decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFFFF))
|
||||
);
|
||||
|
||||
flexRoot.add(new RenderPadding(padding: const EdgeDims.all(10.0), child: renderDecoratedBlock));
|
||||
@@ -37,11 +35,11 @@ RenderBox buildFlexExample() {
|
||||
var row = new RenderFlex(direction: FlexDirection.horizontal);
|
||||
|
||||
// Purple and blue cells
|
||||
addFlexChildSolidColor(row, const ui.Color(0x77FF00FF), flex: 1);
|
||||
addFlexChildSolidColor(row, const ui.Color(0xFF0000FF), flex: 2);
|
||||
addFlexChildSolidColor(row, const Color(0x77FF00FF), flex: 1);
|
||||
addFlexChildSolidColor(row, const Color(0xFF0000FF), flex: 2);
|
||||
|
||||
var decoratedRow = new RenderDecoratedBox(
|
||||
decoration: new BoxDecoration(backgroundColor: const ui.Color(0xFF333333)),
|
||||
decoration: new BoxDecoration(backgroundColor: const Color(0xFF333333)),
|
||||
child: row
|
||||
);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui' as ui;
|
||||
import 'dart:ui' as ui show Image, window;
|
||||
import 'dart:math' as math;
|
||||
import 'dart:typed_data';
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/rendering.dart';
|
||||
|
||||
import 'lib/solid_color_box.dart';
|
||||
@@ -14,16 +12,16 @@ RenderTransform transformBox;
|
||||
void main() {
|
||||
RenderFlex flexRoot = new RenderFlex(direction: FlexDirection.vertical);
|
||||
|
||||
void addFlexChildSolidColor(RenderFlex parent, ui.Color backgroundColor, { int flex: 0 }) {
|
||||
void addFlexChildSolidColor(RenderFlex parent, Color backgroundColor, { int flex: 0 }) {
|
||||
RenderSolidColorBox child = new RenderSolidColorBox(backgroundColor);
|
||||
parent.add(child);
|
||||
final FlexParentData childParentData = child.parentData;
|
||||
childParentData.flex = flex;
|
||||
}
|
||||
|
||||
addFlexChildSolidColor(flexRoot, const ui.Color(0xFFFF00FF), flex: 1);
|
||||
addFlexChildSolidColor(flexRoot, const ui.Color(0xFFFFFF00), flex: 2);
|
||||
addFlexChildSolidColor(flexRoot, const ui.Color(0xFF00FFFF), flex: 1);
|
||||
addFlexChildSolidColor(flexRoot, const Color(0xFFFF00FF), flex: 1);
|
||||
addFlexChildSolidColor(flexRoot, const Color(0xFFFFFF00), flex: 2);
|
||||
addFlexChildSolidColor(flexRoot, const Color(0xFF00FFFF), flex: 1);
|
||||
|
||||
transformBox = new RenderTransform(child: flexRoot, transform: new Matrix4.identity());
|
||||
|
||||
|
||||
@@ -2,16 +2,14 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/rendering.dart';
|
||||
|
||||
void main() {
|
||||
RenderDecoratedBox green = new RenderDecoratedBox(
|
||||
decoration: new BoxDecoration(backgroundColor: const ui.Color(0xFF00FF00))
|
||||
decoration: new BoxDecoration(backgroundColor: const Color(0xFF00FF00))
|
||||
);
|
||||
RenderConstrainedBox box = new RenderConstrainedBox(
|
||||
additionalConstraints: new BoxConstraints.tight(const ui.Size(200.0, 200.0)),
|
||||
additionalConstraints: new BoxConstraints.tight(const Size(200.0, 200.0)),
|
||||
child: green
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user