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:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user