upi_intent_mandate 0.0.1 copy "upi_intent_mandate: ^0.0.1" to clipboard
upi_intent_mandate: ^0.0.1 copied to clipboard

Flutter plugin for get the installed upi apps on device and launch the application.

example/lib/main.dart

import 'dart:io';

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

void main() {
  runApp(
    MaterialApp(
      theme: ThemeData(useMaterial3: true),
      home: const MyApp(),
    ),
  );
}

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

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

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

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

  Future<void> getUpi() async {
    if (Platform.isAndroid) {
      var value = await GetUPI.apps();
      upiAppsListAndroid = value.data;
    } else if (Platform.isIOS) {
      var valueIos = await GetUPI.iosApps();
      upiAppsList.clear();
      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: 'your mandate url',
              );
            } else if (Platform.isIOS) {
              getUpi().then((_) {
                GetUPI().showUpiSheet(
                  context,
                  upiAppsList: upiAppsList,
                  mandateUrl: "your mandate url",
                );
              });
            }
          },
          child: const Text("Native Intent"),
        ),
      ),
    );
  }
}
2
likes
0
points
4
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter plugin for get the installed upi apps on device and launch the application.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on upi_intent_mandate

Packages that implement upi_intent_mandate