Codelessly / ResponsiveFramework

Easily make Flutter apps responsive. Automatically adapt UI to different screen sizes. Responsiveness made simple. Demo: https://gallery.codelessly.com/flutterwebsites/minimal/
https://codelessly.com
MIT License
1.28k stars 151 forks source link

Breaks integration tests when used with windows UI scaling #90

Closed CaptainDario closed 1 year ago

CaptainDario commented 2 years ago

I am using this package to handle ui scaling in windows. Because otherwise flutters rescaling breaks my layout. However when I now write my integration tests the size which is returned by tester.getSize() is dependent on the value of the display scaling.

The problem is, I want to click on a widget 25% of its width from the left. When I now do

var Size = tester.getSize();

final gesture = await tester.createGesture();
await gesture.addPointer(location: Offset.zero);
addTearDown(gesture.removePointer);
await tester.pumpAndSettle();

await gesture.down(size - size/2);
await tester.pump(wait);

The position where the click happens is not the same for different values of scaling. Using 200% results in clicking on the edge of my widget, but when I use 100% scaling it clicks in the center.

Any ideas on how to fix that? Additionally, I am using tutorial coach mark which highlights widgets based on their position. This also does not work when the scaling is different than 100%. I saw those issues: #80, #67, #75, but I am not sure if this is directly related. @searchy2 As all of those do not have a solution, it would be very nice to get an idea of the package author what on how to fix this.