ussd 0.0.2+1 copy "ussd: ^0.0.2+1" to clipboard
ussd: ^0.0.2+1 copied to clipboard

discontinued

Run ussd code directly in your application.

ussd #

GitHub

Run ussd code directly in your application

Getting Started #

On Android you'll need to add either the ACCESS_CALL_PHONE permission to your Android Manifest. To do so open the AndroidManifest.xml file (located under android/app/src/main) and add one of the following one line as direct children of the <manifest> tag:

<uses-permission android:name="android.permission.CALL_PHONE"/>

main.dart #


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

import 'package:ussd/ussd.dart';

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

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

class _MyAppState extends State<MyApp> {

  @override
  void initState() {
    super.initState();
  }

  Future<void> launchUssd(String ussdCode) async {
    Ussd.runUssd(ussdCode);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Run ussd code plugin by mandreshope'),
        ),
        body: Center(
          child: Column(
            children: <Widget>[
              RaisedButton(
                onPressed: () {
                  launchUssd("#123#");
                }, 
                child: Text("Tap to run ussd Orange Mg operator"),
              ),
              RaisedButton(
                onPressed: () {
                  launchUssd("*999#");
                }, 
                child: Text("Tap to run ussd Airtel Mg operator"),
              ),
            ],
          )
        ),
      ),
    );
  }
}

17
likes
30
pub points
53%
popularity

Publisher

verified publishervincent-kammerer.com

Run ussd code directly in your application.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on ussd