startapp_sdk_flutter 0.0.8

  • Readme
  • Changelog
  • Example
  • Installing
  • new64

Startapp SDK Plugin #

Supported both iOS and Android. Note: Only show banner ad currently (still beta with fixed size)

Getting Started #

  1. Initialization
Startapp.instance.initialize('your_app_id');
  1. Add banner ad
StartappBanner(
          listener: handleEvent,
          adSize: StartappBannerSize.BANNER,
        )
  1. Events
 void handleEvent(StartappEvent event) {
    switch (event) {
      case StartappEvent.onClick:
        print('Received: onClick!');
        break;
      case StartappEvent.onReceiveAd:
        print('Received: onReceiveAd');
        break;
      case StartappEvent.onImpression:
        print('Received: onImpression');
        break;
      case StartappEvent.onFailedToReceiveAd:
        print('Received: onFailedToReceiveAd');
        break;
      default:
    }
  }

Getting Started #

Implement Interstitial Ad and Rewarded Video Ad

Support #

Thanks for your coffee :D

Buy me a coffee

0.0.7 #

  • TODO: Bug fixes

example/lib/main.dart

import 'dart:io';

import 'package:flutter/material.dart';
import 'dart:async';
import 'package:startapp_sdk_flutter/startapp_sdk_flutter.dart';
import 'package:startapp_sdk_flutter/src/startapp_banner.dart';
import 'package:startapp_sdk_flutter/src/startapp_banner_size.dart';

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  GlobalKey<ScaffoldState> scaffoldState = GlobalKey();
  @override
  void initState() {
    super.initState();
    initApp();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initApp() async {
    Startapp.instance.initialize(accountId: '106312045', appId: Platform.isIOS ? '202107088' : '202359319');
  }

  void showSnackBar(String content) {
    scaffoldState.currentState.showSnackBar(SnackBar(
      content: Text(content),
      duration: Duration(milliseconds: 10000),
    ));
  }

  void handleEvent(StartappEvent event) {
    switch (event) {
      case StartappEvent.onClick:
        showSnackBar('Received: onClick!');
        break;
      case StartappEvent.onReceiveAd:
        showSnackBar('Received: onReceiveAd');
        break;
      case StartappEvent.onImpression:
        showSnackBar('Received: onImpression');
        break;
      case StartappEvent.onFailedToReceiveAd:
        showSnackBar('Received: onFailedToReceiveAd');
        break;
      default:
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        key: scaffoldState,
        appBar: AppBar(
          title: const Text('Plugin example apps'),
        ),
        body: StartappBanner(
          listener: handleEvent,
          adSize: StartappBannerSize.BANNER,
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  startapp_sdk_flutter: ^0.0.8

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_sdk_flutter/startapp_sdk_flutter.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
41
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
64
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health suggestions

Fix lib/src/main.dart. (-0.50 points)

Analysis of lib/src/main.dart reported 1 hint:

line 28 col 31: The value of the local variable 'argumentsMap' isn't used.

Format lib/src/startapp_banner_size.dart.

Run flutter format to format lib/src/startapp_banner_size.dart.

Format lib/src/startapp_controller.dart.

Run flutter format to format lib/src/startapp_controller.dart.

Format lib/src/startapp_event_handler.dart.

Run flutter format to format lib/src/startapp_event_handler.dart.

Format lib/startapp_sdk_flutter.dart.

Run flutter format to format lib/startapp_sdk_flutter.dart.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

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