flutter_billing 0.3.0

  • README.md
  • Example
  • Installing
  • Versions
  • 90


A plugin for Flutter that enables communication with billing API in iOS and Android.

This plugin implements in app purchases rather than Android Pay or Apple Pay. Both Apple and Google collect fees upon each successful transaction made using this plugin.

Warning: This plugin is still under development, some billing features are not available yet and testing has been limited. Feedback and Pull Requests are welcome.


Add flutter_billing flutter_billing as a dependency in pubspec.yaml.

Create an instance of the plugin:

final Billing billing = new Billing(onError: (e) {
  // optionally handle exception

Request available products for purchase:

final List<BillingProduct> products = await billing.getProducts(<String>[


final BillingProduct product = await billing.getProduct('my.product.id');
if (product != null) {
  // success
} else {
  // something went wrong

Request purchased products (each purchase is a product identifier):

final Set<String> purchases = await billing.getPurchases();

Check if a product is already purchased:

final bool purchased = purchases.contains('my.product.id');


final bool purchases = await billing.isPurchased('my.product.id');

Purchase a product:

final bool purchased = await billing.purchase(productId);


This is just an initial version of the plugin. There are still some limitations:

  • One time purchase products are not supported
  • Consumable products are not supported
  • Android subscription are not supported
  • iOS receipt request is not supported
  • iOS subscriptions are not supported


  • Fixes of product types and type system of dart


  • Fix build issues of 0.2.4


  • Consumable products support for Android
  • Subscription support for Android
  • Receipt request support for iOS


  • Fix on Android to queue up early requests prior billing client setup


  • Fix on iOS to return price in cents ($1.99 = 199)


  • Report Exception instead of Error as per type in Dart 2


  • Breaking change. Dart 2 support


  • On iOS product price was passed as double to Dart code


  • Skip a product if information is not fulfilled properly


  • iOS Support. Library is tested on iOS. Feature parity for both iOS and Android.


  • New breaking API to address caching of products and purchases.


  • Basic documented API


  • Initial Release


import 'package:flutter/material.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => new _MyAppState();

class _MyAppState extends State<MyApp> {
  initState() {

  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('Plugin example app'),
        body: new Center(
          child: new Text('Billing.'),

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_billing: ^0.3.0

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_billing/flutter_billing.dart';
Version Uploaded Documentation Archive
0.3.0 Oct 20, 2018 Go to the documentation of flutter_billing 0.3.0 Download flutter_billing 0.3.0 archive
0.2.5 Sep 6, 2018 Go to the documentation of flutter_billing 0.2.5 Download flutter_billing 0.2.5 archive
0.2.4 Aug 25, 2018 Go to the documentation of flutter_billing 0.2.4 Download flutter_billing 0.2.4 archive
0.2.3 Jul 25, 2018 Go to the documentation of flutter_billing 0.2.3 Download flutter_billing 0.2.3 archive
0.2.2 Apr 15, 2018 Go to the documentation of flutter_billing 0.2.2 Download flutter_billing 0.2.2 archive
0.2.1 Mar 21, 2018 Go to the documentation of flutter_billing 0.2.1 Download flutter_billing 0.2.1 archive
0.2.0 Mar 20, 2018 Go to the documentation of flutter_billing 0.2.0 Download flutter_billing 0.2.0 archive
0.1.3 Feb 28, 2018 Go to the documentation of flutter_billing 0.1.3 Download flutter_billing 0.1.3 archive
0.1.2 Feb 10, 2018 Go to the documentation of flutter_billing 0.1.2 Download flutter_billing 0.1.2 archive
0.1.1 Jan 28, 2018 Go to the documentation of flutter_billing 0.1.1 Download flutter_billing 0.1.1 archive

All 13 versions...

Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7
  • Flutter: 1.0.0


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
flutter 0.0.0
synchronized ^1.5.3 1.5.3
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8