hover_ussd 1.0.0 icon indicating copy to clipboard operation
hover_ussd: ^1.0.0 copied to clipboard

PlatformAndroid

A flutter plugin to make payments by usehover.com ussd gateway using Android Intent and receiving the transaction information back in response.

hover_ussd #

build Pub Star on GitHub Flutter Website License: MIT

© image by Francis Mwakitumbula

A flutter plugin to make payments by usehover.com ussd gateway using Android Intent and receiving the transaction information back in response. android only

Getting Started #

 <meta-data
        android:name="com.hover.ApiKey"  
        android:value="<YOUR_API_TOKEN>"/>

Usage #

  • Example
import 'package:flutter/material.dart';

import 'package:hover_ussd/hover_ussd.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  HoverUssd.initialize();
  runApp(MyApp());
}

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

class _MyAppState extends State<MyApp> {
  final HoverUssd _hoverUssd = HoverUssd();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Row(
            children: [
              FlatButton(
                onPressed: () {
                  _hoverUssd.sendUssd(
                      actionId: "c6e45e62", extras: {"price": "4000"});
                },
                child: Text("Start Trasaction"),
              ),
              StreamBuilder(
                stream: _hoverUssd.getUssdTransactionState,
                builder: (BuildContext context, AsyncSnapshot snapshot) {
                  if (snapshot.data == TransactionState.succesfull) {
                    return Text("succesfull");
                  } else if (snapshot.data ==
                      TransactionState.actionDowaloadFailed) {
                    return Text("action download failed");
                  } else if (snapshot.data == TransactionState.failed) {
                    return Text("failed");
                  }
                  return Text("no transaction");
                },
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Features #

  • start a transaction
  • listen for result
  • customization
  • translation

Important #

  • Production ready
  • This is a unofficial plugin

Maintainers #

22
likes
130
pub points
62%
popularity

Publisher

verified publisher iconlucdotdev.me

A flutter plugin to make payments by usehover.com ussd gateway using Android Intent and receiving the transaction information back in response.

Homepage

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter, meta

More

Packages that depend on hover_ussd