wonderpush_flutter 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • new66

WonderPush Flutter SDK #

Mobile push notification delivery with the WonderPush service. The WonderPush Flutter SDK is compatible with iOS and Android.

WonderPush is the most effective way to retain your users and grow your audience while remaining fully GDPR compliant.

With this plugin, integrate push notification in minutes in your hybrid iOS and Android app.

You can automate notifications based on user behavior, create user segments, and customize the subscription process for visitors.

WonderPush offers a 14-day free trial. After the trial period, you can benefit from unlimited push notifications and all the features from 1 euro per month. There are no limits on the number of push notifications you can send.

Our features include rich formats, automation, realtime analytics, powerful segmentation... All our features are included and you benefit from evolutions without ever having to pay more.

Company #

WonderPush is trusted by over 5,000 developers in Europe and Worldwide.

WonderPush never shares your data with third parties. Your data is safe with us and we protect the privacy of your users as if they were ours. Data collected by our SDKs is fully documented and hosted in Europe.

We provide ready-made tools to collect and manage user consent, and let users download or delete all their data.

Features #

  • Automatic notifications - Automatically send personalized notifications to users that match certain criteria

  • Segmentation - Send notifications to specific subscribers based on language, tags, events or properties.

  • Real-time Analytics - See delivery metrics in real time, and watch them as they convert into visits.

  • Advanced dashboard - Discover the power of push notification automation. Manage segments and campaigns. Invite staff to join your project.

Installation #

See our Flutter Installation Guide.

Reference #

Check out the API reference for a list of available methods. There's also a dartdoc reference.

Migrate from OneSignal plugin and others #

If you need to be GDPR compliant and you already use a push notification plugin, migrating to WonderPush is easy: all you have to do is add the WonderPush plugin to your app and disable the other plugin.

Once you have the WonderPush plugin on your app, users who install the latest version of your app and have already granted push notification permission will automatically appear among your subscribers without having to subscribe again.

Change log and releases #

See the releases page on GitHub.

Follow our announcements on our community forum.

Support #

Contact support using the live chat on your dashboard.

Ask for help on our community forum.

Report a bug, file a feature request or send a pull request in the issue tracker.

1.0.1 #

  • Added dartdoc, better example

1.0.0 #


import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:wonderpush_flutter/wonderpush_flutter.dart';

// Installation instructions:
// https://docs.wonderpush.com/docs/flutter-push-notifications

// To test this example, you'll have to adapt your Client ID and Client Secret in the following files:
// - example/android/app/build.gradle
// - example/ios/Runner/AppDelegate.m
// You can find these values on your [wonderpush dashboard](https://dashboard.wonderpush.com/)

void main() {
  if (kDebugMode) {

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
        // This makes the visual density adapt to the platform that you run
        // the app on. For desktop platforms, the controls will be smaller and
        // closer together (more dense) than on mobile platforms.
        visualDensity: VisualDensity.adaptivePlatformDensity,
      home: MyHomePage(title: 'Flutter Demo Home Page'),

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  _MyHomePageState createState() => _MyHomePageState();

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      WonderPush.setProperty("int_counter", _counter).then((value) {
        // Value of the counter is now sent to WonderPush and available for segmentation
      }, onError: (error) {
        // An error occurred

  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: Column(
          // Column is also a layout widget. It takes a list of children and
          // arranges them vertically. By default, it sizes itself to fit its
          // children horizontally, and tries to be as tall as its parent.
          // Invoke "debug painting" (press "p" in the console, choose the
          // "Toggle Debug Paint" action from the Flutter Inspector in Android
          // Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
          // to see the wireframe for each widget.
          // Column has various properties to control how it sizes itself and
          // how it positions its children. Here we use mainAxisAlignment to
          // center the children vertically; the main axis here is the vertical
          // axis because Columns are vertical (the cross axis would be
          // horizontal).
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
              'You have pushed the button this many times:',
              style: Theme.of(context).textTheme.headline4,
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.

Use this package as a library

1. Depend on it

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

  wonderpush_flutter: ^1.0.1

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:wonderpush_flutter/wonderpush_flutter.dart';
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 Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:wonderpush_flutter/wonderpush_flutter.dart] that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because of import path [package:wonderpush_flutter/wonderpush_flutter.dart] that declares support for platforms: android, ios

Package does not support Flutter platform web

Because of import path [package:wonderpush_flutter/wonderpush_flutter.dart] that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because of import path [package:wonderpush_flutter/wonderpush_flutter.dart] that declares support for platforms: android, ios

Package not compatible with SDK dart

because of import path [wonderpush_flutter] that is in a package requiring null.


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
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies