flutter_custom_tabs icon indicating copy to clipboard operation
flutter_custom_tabs copied to clipboard

Await not working

Open Dev-E-Mobile opened this issue 9 months ago • 1 comments

Hi @droibit @petermnt @davidmigloz @Gurkengewuerz

When utilizing custom tabs with a URL, it doesn't wait until it's finished rather than executing next methods.

await launchUrl( Uri.parse(url), prefersDeepLink: true, customTabsOptions: CustomTabsOptions( colorSchemes: CustomTabsColorSchemes.defaults( toolbarColor: Colors.white, ), shareState: CustomTabsShareState.off, ), safariVCOptions: const SafariViewControllerOptions( preferredBarTintColor: Colors.white, preferredControlTintColor: Colors.white, ), ); await storeTokens();

storeTokens()async{
await storevalues with SharedPrefrences
}

After calling launchurl, the storeTokens function is called, but must wait for it to finish.

@droibit have a look at this issue

Dev-E-Mobile avatar Mar 18 '25 09:03 Dev-E-Mobile

This is the intended behavior - launchUrl waits until the Custom Tab is launched but doesn't wait for it to close.

While I could implement a "wait until closed" feature on iOS,
I haven't found a reliable solution for Android, especially with Custom Tabs that support Picture-in-Picture mode.

I'm considering adding this functionality if I can implement consistent behavior across platforms, but don't have a timeline yet.

droibit avatar Mar 23 '25 13:03 droibit