get_upi 0.0.3+2
get_upi: ^0.0.3+2 copied to clipboard
Flutter plugin for get the installed upi apps on device and launch the application.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:get_upi/get_upi.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
List<UpiObject> upiAppsList = [];
@override
void initState() {
getUpi();
super.initState();
}
void getUpi() async {
var value = await GetUPI.apps();
upiAppsList = value.data;
setState(() {});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: ElevatedButton(
onPressed: () {
GetUPI.openNativeIntent(
url: '',
);
},
child: const Text("Native Intent"),
),
),
// body: GridView.builder(
// itemCount: upiAppsList.length,
// gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 4,
// mainAxisSpacing: 5,
// mainAxisExtent: 80,
// ),
// physics: const NeverScrollableScrollPhysics(),
// shrinkWrap: true,
// itemBuilder: (context, index) {
// final upiApp = upiAppsList[index];
// return InkWell(
// onTap: () {
// GetUPI.launch(
// package: upiApp.packageName,
// url: '',
// );
// },
// borderRadius: BorderRadius.circular(10),
// child: Container(
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(10),
// ),
// child: Column(
// mainAxisSize: MainAxisSize.min,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Image.memory(
// base64Decode(upiApp.icon),
// height: 32,
// width: 32,
// ),
// const SizedBox(height: 15),
// Text(
// upiApp.name,
// textAlign: TextAlign.center,
// style: const TextStyle(fontSize: 12),
// ),
// ],
// ),
// ),
// );
// },
// ),
),
);
}
}