Null check error on RevenueCat offerings

Integrations

In the current implementation, this:

produces the following code:

revenue_cat.offerings!.current!.getPackage('premium-annual')!.storeProduct.priceString

Most of the time, this is fine. However, sometimes, RevenueCat doesn't retrieve any information (as when the app is offline).

This then generates unhandled null check errors:

How can I test if revenue_cat.offerings is not null and not empty, and if revenue_cat.offerings.current is not null ?

What have you tried so far?

I can't manage to locate a valid option. The only ones I have are:

Did you check FlutterFlow's Documentation for this topic?
Yes
3
2 replies