cafebazaar_flutter 1.0.0 cafebazaar_flutter: ^1.0.0 copied to clipboard
CafeBazaar In-App Billing package for flutter upgrade to poolakey this package is just for android applications
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:cafebazaar_flutter/cafebazaar_flutter.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
InAppPurchase inApp;
CafebazaarFlutter _bazaar;
@override
void initState() {
super.initState();
_bazaar = CafebazaarFlutter.instance;
inApp = _bazaar.inAppPurchase("Public Token");
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Column(
children: [
ElevatedButton(onPressed: () {
inApp.purchase("m2");
},child: Text("Pay")),
],
)
),
),
);
}
}