flutter_store_kit 1.0.4 copy "flutter_store_kit: ^1.0.4" to clipboard
flutter_store_kit: ^1.0.4 copied to clipboard

Simplify in-app purchases in Flutter apps with `FlutterStoreKit`. Manage initialization, purchases, and subscriptions with ease. Ideal for premium content and subscriptions.

FlutterStoreKit Library #

FlutterStoreKit is a Flutter library that provides functionality for managing in-app purchases and subscriptions. This documentation outlines how to use the FlutterStoreKit library in your Flutter app.

1. Initialize the Store #

Initialize the store with your product IDs:

void main() {
  StoreKit.instance.initialize([
    'subscription_id1',
    'subscription_id2',
    'subscription_id3',
  ]);
}

2. Add Listeners #

Add Pro Status Changed Listener Add a listener for pro status changes:

void _onProStatusChanged() {
  // Update UI based on purchase status
}

StoreKit.instance.addProStatusChangedListener(_onProStatusChanged);

Remove Pro Status Changed Listener Remove a listener for pro status changes:

StoreKit.instance.removeProStatusChangedListener(_onProStatusChanged);

Add Error Listener Add a listener for errors:

void _onError(String error) {
  // Handle error
  print("Error: $error");
}

StoreKit.instance.addErrorListener(_onError);

Remove Error Listener Remove a listener for errors:

StoreKit.instance.removeErrorListener(_onError);

3. Purchases #

Restore Past Purchases Restore past purchases for the user:

await StoreKit.instance.restorePastPurchases(context);

Purchase a Subscription Purchase a subscription item:

await StoreKit.instance.purchaseSubscription(subscriptionItem);

Open Subscription Management Page Open the subscription management page for the user:

await StoreKit.instance.openSubscriptionManagementPage();

Check if Product is Purchased Check if a product has been purchased:

bool purchased = StoreKit.instance.isProductPurchased('product_id');

Get Purchased Product IDs Get a list of purchased product IDs:

List<String> purchasedIds = StoreKit.instance.getPurchasedProductIds();

4. Disposal #

Dispose of the store instance:

StoreKit.instance.dispose();
2
likes
160
points
53
downloads

Publisher

unverified uploader

Weekly Downloads

Simplify in-app purchases in Flutter apps with `FlutterStoreKit`. Manage initialization, purchases, and subscriptions with ease. Ideal for premium content and subscriptions.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_inapp_purchase, url_launcher

More

Packages that depend on flutter_store_kit