flutter_basqet 1.0.1 copy "flutter_basqet: ^1.0.1" to clipboard
flutter_basqet: ^1.0.1 copied to clipboard

Official plugin for using Basqet SDK with flutter https://basqet.com/.

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      debugShowCheckedModeBanner: false,
      home: const TestBasqet(),
    );
  }
}

class TestBasqet extends StatelessWidget {
  const TestBasqet({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SizedBox(
        height: MediaQuery.of(context).size.height,
        width: MediaQuery.of(context).size.width,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            TextButton(
              onPressed: () {
                BasqetFlutter.launchBasqet(
                  context,
                  publicKey: '<public_key>',
                  email: 'olalekan@gmail.com',
                  description: 'welcome to a special type of check out.',
                  currency: "ngn",
                  amount: "2000",
                  onClose: () {
                    print("modal closed");
                  },
                  onAbandoned: () {
                    print("checkout Abandoned");
                  },
                  onSuccess: (code) {
                    print(code);
                    Navigator.of(context).pop();
                  },
                  onError: (error) {
                    print(error);
                    print("on error");
                  },
                );
              },
              child: const Text("Pay wih basqet"),
            )
          ],
        ),
      ),
    );
  }
}
4
likes
70
pub points
0%
popularity

Publisher

unverified uploader

Official plugin for using Basqet SDK with flutter https://basqet.com/.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, webview_flutter

More

Packages that depend on flutter_basqet