Flutter - how to show progress dialog until pay screen loads on button click?

  • 2 December 2021
  • 1 reply


I have 4 buttons in my app for subscription and one time purchases. In android when we click on button its immediately loads pay-screen but in iOS its take some time to show pay wall. How to show a progress dialog until pay wall loads?  

I am using like this below!

onClick: () async{
    await Purchases.purchasePackage(package!);


Best answer by cody 14 December 2021, 13:48

View original

1 reply

Userlevel 4
Badge +8

Hey @Rajesh!

This behavior may vary from app to app, but in general you can display a loading indicator before calling purchasePackage, then dismissing the loading indicator once your `await` statement completes (after the purchase method returns PurchaserInfo). The method returns the updated PurchaserInfo, so you can go ahead and remove the loading indicator at that time.

The system iOS payment sheet will cover your app’s content, so it’s safe to display a loading indicator when calling that method.