dartins 0.0.2 copy "dartins: ^0.0.2" to clipboard
dartins: ^0.0.2 copied to clipboard

outdatedDart 1 only

Cordova plugin definitions for use in Dart projects

Dartins #

Cordova pugin definitions for use in Dart projects.

Generally speaking, any interactions with plugins should happen after the "deviceReady" event has fired. See example for a simple implementation.

Supported plugins #

  • Device
  • Platform (property)
  • UUID (property)
  • Splashscreen
  • show();
  • hide();
  • AdMob (Pro Version)
  • createBanner(BannerOptions options);
  • hideBanner();
  • showBanner(int position);
  • showBannerAtXY(int x, int y);
  • removeBanner();
  • prepareInterstitial(InterstitialOptions options);
  • showInterstitial();
  • In-app Purchase
  • ProductEvent when(String v);
  • refresh();
  • order(String v);
  • ready(Function v);
  • register(StoreProduct product);
  • Google Analytics
  • startTrackerWithId(String v);
  • trackView(String v);
  • trackEvent(String category, String action, [String label, num v]);
  • trackException(String description, bool fatal);
  • trackTiming(String category, num intervalInMilliseconds, String v, String label);
  • addTransaction(String id, String affiliation, num revenue, num tax, num shipping, String currencyCode);
  • addTransactionItem(String id, String name, String sku, String category, num price, num quantity, String currencyCode);
  • addCustomDimension(String key, String value, [Function success, Function error]);
  • setUserId(String id);
  • debugMode();
  • enableUncaughtExceptionReporting(bool enable, [Function success, Function error]);

Usage #

A simple usage example:

import 'dart:html';
import 'package:dartins/dartins.dart';

main() {
	document.on['deviceready'].listen((_){

	    //Device Example
	    var currentPlatform = Device.platform;
	    print('Currently using a ${currentPlatform} device');

	    //Splashscreen Example
	    Splashscreen.hide();

	    //AdMob example
	    AdMob.createBanner(new BannerOptions(
			adId: 'cx-xxx',
			position: AdMobPosition.BOTTOM_CENTER.index,
			isTesting: Device.UUID == '123123',
			overlap: true
		));

		//Store example
		Store.register(new StoreProduct(id: 'product1', type: StoreProduct.NON_CONSUMABLE));
        Store.when('product1').approved(allowInterop((var product){
            print('Successfully bought product1');
            product.finish();
        }));
        Store.when('product1').owned(allowInterop((var product){
            print('Owns product1');
        }));

        //Analytics example
        GoogleAnalytics.startTrackerWithId('xxx-xxx');
        GoogleAnalytics.trackView('mainMenu');
        GoogleAnalytics.trackEvent('AppState', 'started');
	});
}
2
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Cordova plugin definitions for use in Dart projects

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

js

More

Packages that depend on dartins