startapp 0.5.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 84

Flutter - StartApp SDK Plugin #

Flutter plugin for StartApp SDK.

Currently, this plugin only support Android platform. The plugin is my weekend project, so any contributes to make it better are welcome.

How to use the plugin #

  • Updating AndroidManifest.xml file

Base on StartApp SDK document

Add following meta-data tag with your StartApp App Id under the

<meta-data android:name="com.startapp.sdk.APPLICATION_ID" android:value="startapp_app_id" />

If you want to disable return ads (they are enabled by default) please add following meta-data tag:

<meta-data android:name="com.startapp.sdk.RETURN_ADS_ENABLED" android:value="false" />

If you want to disable splash ads (they are enabled by default) please add following meta-data tag:

<meta-data android:name="vn.momo.plugin.startapp.SPLASH_AD_ENABLED" android:value="false" />
  • Banner as widget
import 'package:startapp/startapp.dart';
...

// StartApp AdBanner as widget
AdBanner(),
  • Load interstitial ad
import 'package:startapp/startapp.dart';
...
await StartApp.showInterstitialAd();
  • Load rewarded video ad
import 'package:startapp/startapp.dart';
...
await StartApp.showRewardedAd(onVideoCompleted: () {
    // video completed callback
}, onReceiveAd: () {
    // ad received callback
}, onFailedToReceiveAd: (String error) {
    // failed to received ad callback
});

Support #

If this package was helpful to you in delivering on your project or you just wanna to support this project, a cup of coffee would be highly appreciated ;-)

Buy me a coffee

0.5.0 #

  • BREAKING CHANGES: Change the method of setting StartApp ID. Please update as README.md file.
  • Upgrade to StartApp SDK 4.6.+.
  • Support enable/disable Splash Ad, Return Ad. See README.md for more details.

0.4.0 #

0.3.0+1 #

  • Update content of README.md

0.3.0 #

  • Support showing Rewarded video ad (with necessary callback)
  • Upgrade StartApp SDK to 4.4.1
  • AndroidX compatibility

0.2.0+1 #

  • Update content of README.md

0.2.0 #

  • Add show interstitial ad utility method
  • Update document and configuration follow pub.dev suggestion

0.1.0+1 #

  • Update document and configuration follow pub.dev suggestion

0.1.0 #

  • Support load interstitial ad method

0.0.1 #

  • TODO: Describe initial release.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:startapp/startapp.dart';

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

class MyApp extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => MyAppState();
}

class MyAppState extends State<MyApp> {
  bool videoCompleted = false;
  String error = '';

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: "StartApp Example",
        home: Scaffold(
            appBar: AppBar(title: const Text('StartApp Example')),
            body: Center(
                child: Column(
              children: <Widget>[
                Text('Banner sample'),

                // StartApp AdBanner as widget
                AdBanner(),

                // Display StartApp interstitial ad
                RaisedButton(
                    child: Text('Show interstitial ad'),
                    onPressed: () async {
                      await StartApp.showInterstitialAd();
                    }),

                // Display StartApp rewarded ad
                RaisedButton(
                    child: Text('Show rewarded ad'),
                    onPressed: () async {
                      await StartApp.showRewardedAd(onVideoCompleted: () {
                        setState(() {
                          videoCompleted = true;
                        });
                      }, onFailedToReceiveAd: (String error) {
                        this.error = error;
                      });
                    }),
                Text(videoCompleted ? 'Video completed!' : '',
                  style: TextStyle(color: Colors.green),
                ),
                Text(error == '' ? '' : 'Video ad error: $error',
                  style: TextStyle(color: Colors.red),
                ),
              ],
            ))));
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  startapp: ^0.5.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:startapp/startapp.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
68
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
84
Learn more about scoring.

We analyzed this package on Jul 9, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform ios

Because:

  • package:startapp/startapp.dart that declares support for platforms: android

Package does not support Flutter platform linux

Because:

  • package:startapp/startapp.dart that declares support for platforms: android

Package does not support Flutter platform macos

Because:

  • package:startapp/startapp.dart that declares support for platforms: android

Package does not support Flutter platform web

Because:

  • package:startapp/startapp.dart that declares support for platforms: android

Package does not support Flutter platform windows

Because:

  • package:startapp/startapp.dart that declares support for platforms: android

Package not compatible with SDK dart

Because:

  • startapp that is a package requiring null.

Health suggestions

Format lib/startapp.dart.

Run flutter format to format lib/startapp.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test