upi_intent_list 0.0.3 copy "upi_intent_list: ^0.0.3" to clipboard
upi_intent_list: ^0.0.3 copied to clipboard

A Flutter plugin to retrieve the list of installed UPI applications on a device and launch a selected app.

example/lib/main.dart

import 'dart:developer';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:upi_intent_list/upi_intent_list.dart';


void main() {
  runApp(MaterialApp(home: const MyApp()));
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  List upiAppsList = [];

  MethodChannel methodChannel = const MethodChannel("get_upi");
  @override
  void initState() {
    super.initState();
  }

  Future<void> getUpi() async {
    var valueIos = await GetUPI.iosApps();
    upiAppsList.clear();

    log("META  valueIos : $valueIos");
    upiAppsList = valueIos;

    setState(() {});
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Plugin example app'),
      ),
      body: Center(
        child: ElevatedButton(
          onPressed: () {
            if (Platform.isAndroid) {
              GetUPI.openNativeIntent(
                url:
                'upi://mandate?pa=ippoautopay@icici&pn=IPPOPAY%20TECHNOLOGIES&tr=EZM2023070112223506269543&am=2000.00&cu=INR&orgid=400011&mc=5818&purpose=14&tn=Mandate%20for%20Sound%20box&validitystart=01072023&validityend=01072053&amrule=MAX&recur=ASPRESENTED&rev=Y&share=Y&block=N&txnType=CREATE&mode=13',
              );
            } else {
              getUpi().then((_) {
                GetUPI().showUpiSheet(context, mandateUrl: "upi://mandate?pa=ippoautopay@icici&pn=IPPOPAY%20TECHNOLOGIES&tr=EZM2023070112223506269543&am=2000.00&cu=INR&orgid=400011&mc=5818&purpose=14&tn=Mandate%20for%20Sound%20box&validitystart=01072023&validityend=01072053&amrule=MAX&recur=ASPRESENTED&rev=Y&share=Y&block=N&txnType=CREATE&mode=13",upiAppsList: upiAppsList);
              });
            }
          },
          child: const Text("Native Intent"),
        ),
      ),
    );
  }
}
1
likes
130
points
8
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin to retrieve the list of installed UPI applications on a device and launch a selected app.

Homepage

Documentation

API reference

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on upi_intent_list

Packages that implement upi_intent_list