Last active
March 5, 2023 05:57
-
-
Save Boehrsi/93c26371431367a639476a3a860ead60 to your computer and use it in GitHub Desktop.
During development I encountered https://github.com/flutter/flutter/issues/41029 and didn't liked the solution with hardcoded waiting times. I'm now waiting for the first frame to be rastered successfully and ignoring errors in the meantime. This works well for my tests and avoids hardcoded timings, which often fail (e.g. on a different machine).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<FlutterDriver> setupAndGetDriver() async { | |
FlutterDriver driver = await FlutterDriver.connect(); | |
var connected = false; | |
while (!connected) { | |
try { | |
await driver.waitUntilFirstFrameRasterized(); | |
connected = true; | |
} catch (error) {} | |
} | |
return driver; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you really help me out!!