avioli / uni_links

Flutter plugin for accepting incoming links.
BSD 2-Clause "Simplified" License
563 stars 303 forks source link

Two build() methods interfering when deeplink comes back #27

Closed naiveai closed 5 years ago

naiveai commented 5 years ago

I'm using custom scheme and am testing on my Google Pixel 2, which is running the Android Q beta (but this is unrelated).

In my main() method, I've registed my getUriLinksStream() to navigate to a specific Page, SuccessPage, after my one and only deeplink comes through. This works on its own, but now I introduce the scenario where my LoginPage is opening up a browser through url_launcher for an OAuth2 flow, then when the deeplink comes back, there's a brief moment for which the LoginPage attempts to rebuild, and then when the Navigator comes along, I get an exception saying setState() or markNeedsBuild() called during build, because they're both interfering. How do I stop them from executing too quickly? Can I delay the stream action somehow?

naiveai commented 5 years ago

Shouldn't make issues at 2am in the middle of debugging... Sorry about that.