mobilepay_appswitch 0.9.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 42

Flutter plugin for MobilePay AppSwitch SDK #

This is an unofficial Flutter plugin wrapping the MobilePay AppSwitch libraries for iOS and Android to enable Flutter apps to use the MobilePay AppSwitch SDK.

This plugin is not developed, published or otherwise affiliated with Danske Bank or MobilePay, but is a private project released "as-is" to the public by the author.

iOS #

For iOS support add the following to your info.plist. Replace mobilepayappswitchexample with your own URL Scheme.


Limitations #

Some pararmeters are not supported like accepted url. But the essentials should work well.

And iOS is not supported... yet.

[0.9.0] - 6. september 2018

  • Support for iOS 9.0 and above

[0.8.1] - 30. august 2018

  • Fixed pubspec.yaml to allow higher Flutter versions

[0.8.0] - 28. august 2018

  • Added support for settings capture type

[0.0.2] - 24. august 2018

  • Fixed wrong return type in init.

[0.0.1] - 24. august 2018

  • Support on Android for essential SDK features.


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

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

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

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

  initAppSwitch() async {
    await MobilepayAppswitch.init(
      merchantId: "APPDK0000000000", 
      country: Country.DENMARK,
      urlScheme: 'mobilepayappswitchexample');

  Widget build(BuildContext context) {
    return new MaterialApp(home: PaymentTest());

class PaymentTest extends StatelessWidget {
  makePayment(BuildContext context, double price) async {
    PaymentResponse paymentResponse =
        await MobilepayAppswitch.makePayment(orderId: "TESTINGS_ID", price: price);

    if (paymentResponse.success) {
          context: context,
          builder: (_) => AlertDialog(
                content: Text("yay"),
                title: Text("Payment successful"),
    } else {
          context: context,
          builder: (_) => AlertDialog(
                title: Text("Failed to complete payment"),
                content: Text("${paymentResponse.error.errorMessage}\nError code: ${paymentResponse.error.errorCode}"),

  Widget build(BuildContext context) {
    return Scaffold(
      appBar: new AppBar(
        title: new Text('Plugin example app'),
      body: new Center(
        child: RaisedButton(
            onPressed: () => makePayment(context, 10.0),
            child: Text("Make payment")),

Use this package as a library

1. Depend on it

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

  mobilepay_appswitch: ^0.9.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:mobilepay_appswitch/mobilepay_appswitch.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 Dec 13, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Health issues and suggestions

Document public APIs. (-1 points)

50 out of 50 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Maintenance suggestions

Package is getting outdated. (-26.85 points)

The package was last published 66 weeks ago.

The package description is too short. (-14 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 Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8