Move Point to Offset (#9277)
* Manually fix every use of Point.x and Point.y
Some of these were moved to dx/dy, but not all.
* Manually convert uses of the old gradient API
* Remove old reference to Point.
* Mechanical changes
I applied the following at the root of the Flutter repository:
git ls-files -z | xargs -0 sed -i 's/\bPoint[.]origin\b/Offset.zero/g'
git ls-files -z | xargs -0 sed -i 's/\bPoint[.]lerp\b/Offset.lerp/g'
git ls-files -z | xargs -0 sed -i 's/\bnew Point\b/new Offset/g'
git ls-files -z | xargs -0 sed -i 's/\bconst Point\b/const Offset/g'
git ls-files -z | xargs -0 sed -i 's/\bstatic Point /static Offset /g'
git ls-files -z | xargs -0 sed -i 's/\bfinal Point /final Offset /g'
git ls-files -z | xargs -0 sed -i 's/^\( *\)Point /\1Offset /g'
git ls-files -z | xargs -0 sed -i 's/ui[.]Point\b/ui.Offset/g'
git ls-files -z | xargs -0 sed -i 's/(Point\b/(Offset/g'
git ls-files -z | xargs -0 sed -i 's/\([[{,]\) Point\b/\1 Offset/g'
git ls-files -z | xargs -0 sed -i 's/@required Point\b/@required Offset/g'
git ls-files -z | xargs -0 sed -i 's/<Point>/<Offset>/g'
git ls-files -z | xargs -0 sed -i 's/[.]toOffset()//g'
git ls-files -z | xargs -0 sed -i 's/[.]toPoint()//g'
git ls-files -z | xargs -0 sed -i 's/\bshow Point, /show /g'
git ls-files -z | xargs -0 sed -i 's/\bshow Point;/show Offset;/g'
* Mechanical changes - dartdocs
I applied the following at the root of the Flutter repository:
git ls-files -z | xargs -0 sed -i 's/\ba \[Point\]/an [Offset]/g'
git ls-files -z | xargs -0 sed -i 's/\[Point\]/[Offset]/g'
* Further improvements and a test
* Fix minor errors from rebasing...
* Roll engine
This commit is contained in:
@@ -178,8 +178,8 @@ class _AllSectionsLayout extends MultiChildLayoutDelegate {
|
||||
return Rect.lerp(begin, end, tColumnToRow);
|
||||
}
|
||||
|
||||
Point _interpolatePoint(Point begin, Point end) {
|
||||
return Point.lerp(begin, end, tColumnToRow);
|
||||
Offset _interpolatePoint(Offset begin, Offset end) {
|
||||
return Offset.lerp(begin, end, tColumnToRow);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -220,30 +220,30 @@ class _AllSectionsLayout extends MultiChildLayoutDelegate {
|
||||
cardRect.left + 0.5, cardRect.top, cardRect.width - 1.0, cardRect.height
|
||||
);
|
||||
layoutChild(cardId, new BoxConstraints.tight(insetRect.size));
|
||||
positionChild(cardId, insetRect.topLeft.toOffset());
|
||||
positionChild(cardId, insetRect.topLeft);
|
||||
}
|
||||
|
||||
// Layout the title for index.
|
||||
final Size titleSize = layoutChild('title$index', new BoxConstraints.loose(cardRect.size));
|
||||
final double columnTitleY = columnCardRect.centerLeft.y - titleSize.height / 2.0;
|
||||
final double rowTitleY = rowCardRect.centerLeft.y - titleSize.height / 2.0;
|
||||
final double columnTitleY = columnCardRect.centerLeft.dy - titleSize.height / 2.0;
|
||||
final double rowTitleY = rowCardRect.centerLeft.dy - titleSize.height / 2.0;
|
||||
final double centeredRowTitleX = rowTitleX + (rowTitleWidth - titleSize.width) / 2.0;
|
||||
final Point columnTitleOrigin = new Point(columnTitleX, columnTitleY);
|
||||
final Point rowTitleOrigin = new Point(centeredRowTitleX, rowTitleY);
|
||||
final Point titleOrigin = _interpolatePoint(columnTitleOrigin, rowTitleOrigin);
|
||||
positionChild('title$index', titleOrigin.toOffset() + offset);
|
||||
final Offset columnTitleOrigin = new Offset(columnTitleX, columnTitleY);
|
||||
final Offset rowTitleOrigin = new Offset(centeredRowTitleX, rowTitleY);
|
||||
final Offset titleOrigin = _interpolatePoint(columnTitleOrigin, rowTitleOrigin);
|
||||
positionChild('title$index', titleOrigin + offset);
|
||||
|
||||
// Layout the selection indicator for index.
|
||||
final Size indicatorSize = layoutChild('indicator$index', new BoxConstraints.loose(cardRect.size));
|
||||
final double columnIndicatorX = cardRect.centerRight.x - indicatorSize.width - 16.0;
|
||||
final double columnIndicatorY = cardRect.bottomRight.y - indicatorSize.height - 16.0;
|
||||
final Point columnIndicatorOrigin = new Point(columnIndicatorX, columnIndicatorY);
|
||||
final double columnIndicatorX = cardRect.centerRight.dx - indicatorSize.width - 16.0;
|
||||
final double columnIndicatorY = cardRect.bottomRight.dy - indicatorSize.height - 16.0;
|
||||
final Offset columnIndicatorOrigin = new Offset(columnIndicatorX, columnIndicatorY);
|
||||
final Rect titleRect = new Rect.fromPoints(titleOrigin, titleSize.bottomRight(titleOrigin));
|
||||
final double centeredRowIndicatorX = rowIndicatorX + (rowIndicatorWidth - indicatorSize.width) / 2.0;
|
||||
final double rowIndicatorY = titleRect.bottomCenter.y + 16.0;
|
||||
final Point rowIndicatorOrigin = new Point(centeredRowIndicatorX, rowIndicatorY);
|
||||
final Point indicatorOrigin = _interpolatePoint(columnIndicatorOrigin, rowIndicatorOrigin);
|
||||
positionChild('indicator$index', indicatorOrigin.toOffset() + offset);
|
||||
final double rowIndicatorY = titleRect.bottomCenter.dy + 16.0;
|
||||
final Offset rowIndicatorOrigin = new Offset(centeredRowIndicatorX, rowIndicatorY);
|
||||
final Offset indicatorOrigin = _interpolatePoint(columnIndicatorOrigin, rowIndicatorOrigin);
|
||||
positionChild('indicator$index', indicatorOrigin + offset);
|
||||
|
||||
columnCardY += columnCardHeight;
|
||||
rowCardX += rowCardWidth;
|
||||
@@ -434,7 +434,7 @@ class _AnimationDemoHomeState extends State<AnimationDemoHome> {
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: new SectionCard(section: allSections[index]),
|
||||
onTapUp: (TapUpDetails details) {
|
||||
final double xOffset = details.globalPosition.x;
|
||||
final double xOffset = details.globalPosition.dx;
|
||||
setState(() {
|
||||
_maybeScroll(midScrollOffset, index, xOffset);
|
||||
});
|
||||
|
||||
@@ -90,7 +90,7 @@ class _GridPhotoViewerState extends State<GridPhotoViewer> with SingleTickerProv
|
||||
void _handleOnScaleStart(ScaleStartDetails details) {
|
||||
setState(() {
|
||||
_previousScale = _scale;
|
||||
_normalizedOffset = (details.focalPoint.toOffset() - _offset) / _scale;
|
||||
_normalizedOffset = (details.focalPoint - _offset) / _scale;
|
||||
// The fling animation stops if an input gesture starts.
|
||||
_controller.stop();
|
||||
});
|
||||
@@ -100,7 +100,7 @@ class _GridPhotoViewerState extends State<GridPhotoViewer> with SingleTickerProv
|
||||
setState(() {
|
||||
_scale = (_previousScale * details.scale).clamp(1.0, 4.0);
|
||||
// Ensure that image location under the focal point stays in the same place despite scaling.
|
||||
_offset = _clampOffset(details.focalPoint.toOffset() - _normalizedOffset * _scale);
|
||||
_offset = _clampOffset(details.focalPoint - _normalizedOffset * _scale);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ class _GridPhotoViewerState extends State<GridPhotoViewer> with SingleTickerProv
|
||||
if (magnitude < _kMinFlingVelocity)
|
||||
return;
|
||||
final Offset direction = details.velocity.pixelsPerSecond / magnitude;
|
||||
final double distance = (Point.origin & context.size).shortestSide;
|
||||
final double distance = (Offset.zero & context.size).shortestSide;
|
||||
_flingAnimation = new Tween<Offset>(
|
||||
begin: _offset,
|
||||
end: _clampOffset(_offset + direction * distance)
|
||||
|
||||
@@ -20,7 +20,7 @@ void main() {
|
||||
|
||||
|
||||
// Scroll the Buttons demo into view so that a tap will succeed
|
||||
final Point allDemosOrigin = tester.getTopRight(find.text('Demos'));
|
||||
final Offset allDemosOrigin = tester.getTopRight(find.text('Demos'));
|
||||
final Finder button = find.text('Buttons');
|
||||
while (button.evaluate().isEmpty) {
|
||||
await tester.dragFrom(allDemosOrigin, const Offset(0.0, -100.0));
|
||||
|
||||
@@ -77,8 +77,8 @@ Future<Null> smokeDemo(WidgetTester tester, String routeName) async {
|
||||
await tester.pump(const Duration(milliseconds: 400));
|
||||
|
||||
// Scroll the demo around a bit.
|
||||
await tester.flingFrom(const Point(400.0, 300.0), const Offset(-100.0, 0.0), 500.0);
|
||||
await tester.flingFrom(const Point(400.0, 300.0), const Offset(0.0, -100.0), 500.0);
|
||||
await tester.flingFrom(const Offset(400.0, 300.0), const Offset(-100.0, 0.0), 500.0);
|
||||
await tester.flingFrom(const Offset(400.0, 300.0), const Offset(0.0, -100.0), 500.0);
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 50));
|
||||
await tester.pump(const Duration(milliseconds: 200));
|
||||
@@ -90,15 +90,15 @@ Future<Null> smokeDemo(WidgetTester tester, String routeName) async {
|
||||
verifyToStringOutput('debugDumpLayerTree', routeName, RendererBinding.instance?.renderView?.debugLayer?.toStringDeep());
|
||||
|
||||
// Scroll the demo around a bit more.
|
||||
await tester.flingFrom(const Point(400.0, 300.0), const Offset(-200.0, 0.0), 500.0);
|
||||
await tester.flingFrom(const Offset(400.0, 300.0), const Offset(-200.0, 0.0), 500.0);
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 50));
|
||||
await tester.pump(const Duration(milliseconds: 200));
|
||||
await tester.pump(const Duration(milliseconds: 400));
|
||||
await tester.flingFrom(const Point(400.0, 300.0), const Offset(100.0, 0.0), 500.0);
|
||||
await tester.flingFrom(const Offset(400.0, 300.0), const Offset(100.0, 0.0), 500.0);
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 400));
|
||||
await tester.flingFrom(const Point(400.0, 300.0), const Offset(0.0, 400.0), 1000.0);
|
||||
await tester.flingFrom(const Offset(400.0, 300.0), const Offset(0.0, 400.0), 1000.0);
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 400));
|
||||
|
||||
|
||||
@@ -26,24 +26,24 @@ ui.Picture paint(ui.Rect paintBounds) {
|
||||
canvas.drawPaint(new ui.Paint()..color = const ui.Color(0xFFFFFFFF));
|
||||
|
||||
final ui.Size size = paintBounds.size;
|
||||
final ui.Point mid = size.center(ui.Point.origin);
|
||||
final ui.Offset mid = size.center(ui.Offset.zero);
|
||||
final double radius = size.shortestSide / 2.0;
|
||||
|
||||
final double devicePixelRatio = ui.window.devicePixelRatio;
|
||||
final ui.Size logicalSize = ui.window.physicalSize / devicePixelRatio;
|
||||
|
||||
canvas.save();
|
||||
canvas.translate(-mid.x/2.0, logicalSize.height*2.0);
|
||||
canvas.clipRect(
|
||||
new ui.Rect.fromLTRB(0.0, -logicalSize.height, logicalSize.width, radius));
|
||||
canvas.translate(-mid.dx / 2.0, logicalSize.height * 2.0);
|
||||
canvas.clipRect(new ui.Rect.fromLTRB(0.0, -logicalSize.height, logicalSize.width, radius));
|
||||
|
||||
canvas.translate(mid.x, mid.y);
|
||||
canvas.translate(mid.dx, mid.dy);
|
||||
paint.color = const ui.Color.fromARGB(128, 255, 0, 255);
|
||||
canvas.rotate(math.PI/4.0);
|
||||
|
||||
final ui.Gradient yellowBlue = new ui.Gradient.linear(
|
||||
<ui.Point>[new ui.Point(-radius, -radius), const ui.Point(0.0, 0.0)],
|
||||
<ui.Color>[const ui.Color(0xFFFFFF00), const ui.Color(0xFF0000FF)]
|
||||
new ui.Offset(-radius, -radius),
|
||||
const ui.Offset(0.0, 0.0),
|
||||
<ui.Color>[const ui.Color(0xFFFFFF00), const ui.Color(0xFF0000FF)],
|
||||
);
|
||||
canvas.drawRect(new ui.Rect.fromLTRB(-radius, -radius, radius, radius),
|
||||
new ui.Paint()..shader = yellowBlue);
|
||||
@@ -57,11 +57,11 @@ ui.Picture paint(ui.Rect paintBounds) {
|
||||
]);
|
||||
canvas.transform(scaleMatrix);
|
||||
paint.color = const ui.Color.fromARGB(128, 0, 255, 0);
|
||||
canvas.drawCircle(ui.Point.origin, radius, paint);
|
||||
canvas.drawCircle(ui.Offset.zero, radius, paint);
|
||||
canvas.restore();
|
||||
|
||||
paint.color = const ui.Color.fromARGB(128, 255, 0, 0);
|
||||
canvas.drawCircle(const ui.Point(150.0, 300.0), radius, paint);
|
||||
canvas.drawCircle(const ui.Offset(150.0, 300.0), radius, paint);
|
||||
|
||||
// When we're done issuing painting commands, we end the recording an receive
|
||||
// a Picture, which is an immutable record of the commands we've issued. You
|
||||
@@ -85,7 +85,7 @@ ui.Scene composite(ui.Picture picture, ui.Rect paintBounds) {
|
||||
}
|
||||
|
||||
void beginFrame(Duration timeStamp) {
|
||||
final ui.Rect paintBounds = ui.Point.origin & (ui.window.physicalSize / ui.window.devicePixelRatio);
|
||||
final ui.Rect paintBounds = ui.Offset.zero & (ui.window.physicalSize / ui.window.devicePixelRatio);
|
||||
final ui.Picture picture = paint(paintBounds);
|
||||
final ui.Scene scene = composite(picture, paintBounds);
|
||||
ui.window.render(scene);
|
||||
|
||||
@@ -16,7 +16,7 @@ void beginFrame(Duration timeStamp) {
|
||||
final ui.Paragraph paragraph = paragraphBuilder.build()
|
||||
..layout(new ui.ParagraphConstraints(width: logicalSize.width));
|
||||
|
||||
final ui.Rect physicalBounds = ui.Point.origin & (logicalSize * devicePixelRatio);
|
||||
final ui.Rect physicalBounds = ui.Offset.zero & (logicalSize * devicePixelRatio);
|
||||
final ui.PictureRecorder recorder = new ui.PictureRecorder();
|
||||
final ui.Canvas canvas = new ui.Canvas(recorder, physicalBounds);
|
||||
canvas.scale(devicePixelRatio, devicePixelRatio);
|
||||
|
||||
@@ -19,7 +19,7 @@ void beginFrame(Duration timeStamp) {
|
||||
|
||||
// PAINT
|
||||
|
||||
final ui.Rect paintBounds = ui.Point.origin & (ui.window.physicalSize / ui.window.devicePixelRatio);
|
||||
final ui.Rect paintBounds = ui.Offset.zero & (ui.window.physicalSize / ui.window.devicePixelRatio);
|
||||
final ui.PictureRecorder recorder = new ui.PictureRecorder();
|
||||
final ui.Canvas canvas = new ui.Canvas(recorder, paintBounds);
|
||||
canvas.translate(paintBounds.width / 2.0, paintBounds.height / 2.0);
|
||||
|
||||
@@ -44,7 +44,7 @@ ui.Scene composite(ui.Picture picture, ui.Rect paintBounds) {
|
||||
}
|
||||
|
||||
void beginFrame(Duration timeStamp) {
|
||||
final ui.Rect paintBounds = ui.Point.origin & (ui.window.physicalSize / ui.window.devicePixelRatio);
|
||||
final ui.Rect paintBounds = ui.Offset.zero & (ui.window.physicalSize / ui.window.devicePixelRatio);
|
||||
final ui.Picture picture = paint(paintBounds);
|
||||
final ui.Scene scene = composite(picture, paintBounds);
|
||||
ui.window.render(scene);
|
||||
|
||||
@@ -26,7 +26,7 @@ ui.Picture paint(ui.Rect paintBounds) {
|
||||
// The commands draw a circle in the center of the screen.
|
||||
final ui.Size size = paintBounds.size;
|
||||
canvas.drawCircle(
|
||||
size.center(ui.Point.origin),
|
||||
size.center(ui.Offset.zero),
|
||||
size.shortestSide * 0.45,
|
||||
new ui.Paint()..color = color
|
||||
);
|
||||
@@ -67,7 +67,7 @@ ui.Scene composite(ui.Picture picture, ui.Rect paintBounds) {
|
||||
}
|
||||
|
||||
void beginFrame(Duration timeStamp) {
|
||||
final ui.Rect paintBounds = ui.Point.origin & (ui.window.physicalSize / ui.window.devicePixelRatio);
|
||||
final ui.Rect paintBounds = ui.Offset.zero & (ui.window.physicalSize / ui.window.devicePixelRatio);
|
||||
// First, record a picture with our painting commands.
|
||||
final ui.Picture picture = paint(paintBounds);
|
||||
// Second, include that picture in a scene graph.
|
||||
|
||||
@@ -525,22 +525,22 @@ class RenderBoxToRenderSectorAdapter extends RenderBox with RenderObjectWithChil
|
||||
if (child != null) {
|
||||
final Rect bounds = offset & size;
|
||||
// we move the offset to the center of the circle for the RenderSectors
|
||||
context.paintChild(child, bounds.center.toOffset());
|
||||
context.paintChild(child, bounds.center);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
bool hitTest(HitTestResult result, { Point position }) {
|
||||
bool hitTest(HitTestResult result, { Offset position }) {
|
||||
if (child == null)
|
||||
return false;
|
||||
double x = position.x;
|
||||
double y = position.y;
|
||||
double x = position.dx;
|
||||
double y = position.dy;
|
||||
// translate to our origin
|
||||
x -= size.width/2.0;
|
||||
y -= size.height/2.0;
|
||||
x -= size.width / 2.0;
|
||||
y -= size.height / 2.0;
|
||||
// convert to radius/theta
|
||||
final double radius = math.sqrt(x*x+y*y);
|
||||
final double theta = (math.atan2(x, -y) - math.PI/2.0) % kTwoPi;
|
||||
final double radius = math.sqrt(x * x + y * y);
|
||||
final double theta = (math.atan2(x, -y) - math.PI / 2.0) % kTwoPi;
|
||||
if (radius < innerRadius)
|
||||
return false;
|
||||
if (radius >= innerRadius + child.deltaRadius)
|
||||
|
||||
@@ -23,7 +23,7 @@ class Dot {
|
||||
Dot({ Color color }) : _paint = new Paint()..color = color;
|
||||
|
||||
final Paint _paint;
|
||||
Point position = Point.origin;
|
||||
Offset position = Offset.zero;
|
||||
double radius = 0.0;
|
||||
|
||||
void update(PointerEvent event) {
|
||||
@@ -58,7 +58,7 @@ class RenderDots extends RenderBox {
|
||||
|
||||
/// Makes this render object hittable so that it receives pointer events.
|
||||
@override
|
||||
bool hitTestSelf(Point position) => true;
|
||||
bool hitTestSelf(Offset position) => true;
|
||||
|
||||
/// Processes pointer events by mutating state and invalidating its previous
|
||||
/// painting commands.
|
||||
|
||||
@@ -10,9 +10,9 @@ class RenderDots extends RenderConstrainedBox {
|
||||
|
||||
// Makes this render box hittable so that we'll get pointer events.
|
||||
@override
|
||||
bool hitTestSelf(Point position) => true;
|
||||
bool hitTestSelf(Offset position) => true;
|
||||
|
||||
final Map<int, Point> _dots = <int, Point>{};
|
||||
final Map<int, Offset> _dots = <int, Offset>{};
|
||||
|
||||
@override
|
||||
void handleEvent(PointerEvent event, BoxHitTestEntry entry) {
|
||||
@@ -31,7 +31,7 @@ class RenderDots extends RenderConstrainedBox {
|
||||
canvas.drawRect(offset & size, new Paint()..color = const Color(0xFF0000FF));
|
||||
|
||||
final Paint paint = new Paint()..color = const Color(0xFF00FF00);
|
||||
for (Point point in _dots.values)
|
||||
for (Offset point in _dots.values)
|
||||
canvas.drawCircle(point, 50.0, paint);
|
||||
|
||||
super.paint(context, offset);
|
||||
|
||||
@@ -27,18 +27,16 @@ class _GesturePainter extends CustomPainter {
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size) {
|
||||
final Point center = (size.center(Point.origin).toOffset() * zoom + offset).toPoint();
|
||||
final Offset center = (size.center(Offset.zero) * zoom + offset);
|
||||
final double radius = size.width / 2.0 * zoom;
|
||||
final Gradient gradient = new RadialGradient(
|
||||
colors: forward ? <Color>[swatch.shade50, swatch.shade900]
|
||||
: <Color>[swatch.shade900, swatch.shade50]
|
||||
);
|
||||
final Paint paint = new Paint()
|
||||
..shader = gradient.createShader(new Rect.fromLTWH(
|
||||
center.x - radius,
|
||||
center.y - radius,
|
||||
radius * 2.0,
|
||||
radius * 2.0
|
||||
..shader = gradient.createShader(new Rect.fromCircle(
|
||||
center: center,
|
||||
radius: radius,
|
||||
));
|
||||
canvas.drawCircle(center, radius, paint);
|
||||
}
|
||||
@@ -63,7 +61,7 @@ class GestureDemo extends StatefulWidget {
|
||||
|
||||
class _GestureDemoState extends State<GestureDemo> {
|
||||
|
||||
Point _startingFocalPoint;
|
||||
Offset _startingFocalPoint;
|
||||
|
||||
Offset _previousOffset;
|
||||
Offset _offset = Offset.zero;
|
||||
@@ -92,8 +90,8 @@ class _GestureDemoState extends State<GestureDemo> {
|
||||
_zoom = (_previousZoom * details.scale);
|
||||
|
||||
// Ensure that item under the focal point stays in the same place despite zooming
|
||||
final Offset normalizedOffset = (_startingFocalPoint.toOffset() - _previousOffset) / _previousZoom;
|
||||
_offset = details.focalPoint.toOffset() - normalizedOffset * _zoom;
|
||||
final Offset normalizedOffset = (_startingFocalPoint - _previousOffset) / _previousZoom;
|
||||
_offset = details.focalPoint - normalizedOffset * _zoom;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class StockArrowPainter extends CustomPainter {
|
||||
|
||||
// Draw a circle that circumscribes the arrow.
|
||||
paint.style = PaintingStyle.stroke;
|
||||
canvas.drawCircle(new Point(centerX, centerY), r, paint);
|
||||
canvas.drawCircle(new Offset(centerX, centerY), r, paint);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -61,8 +61,8 @@ void main() {
|
||||
expect(find.text('Account Balance'), findsNothing);
|
||||
|
||||
// drag the drawer out
|
||||
final Point left = new Point(0.0, ui.window.physicalSize.height / 2.0);
|
||||
final Point right = new Point(ui.window.physicalSize.width, left.y);
|
||||
final Offset left = new Offset(0.0, ui.window.physicalSize.height / 2.0);
|
||||
final Offset right = new Offset(ui.window.physicalSize.width, left.dy);
|
||||
final TestGesture gesture = await tester.startGesture(left);
|
||||
await tester.pump();
|
||||
await gesture.moveTo(right);
|
||||
|
||||
Reference in New Issue
Block a user