rabitlala_flutter_sdk 1.0.0+2
rabitlala_flutter_sdk: ^1.0.0+2 copied to clipboard
A Flutter SDK that enables businesses to accept payments via RabbitLala's checkout system.
π RabbitLala Flutter SDK #
rabitlala_flutter_sdk is a Flutter SDK that allows businesses to easily initiate and complete payments via RabbitLala secure checkout system.
π Features #
- Launch hosted payment checkout via RabbitLala
- Mobile-friendly integration
- Lightweight and easy to integrate
- Backend-driven payment flow via payment reference
π¦ Installation #
Add the SDK to your pubspec.yaml:
flutter pub add rabitlala_flutter_sdk
π§βπ» Usage #
β Import the package: #
import 'package:rabitlala_flutter_sdk/rabbitlala.dart';
β Initialize the SDK: #
Rabbitlala.initialize(mode: Modes.demo); // Modes.live by default
β Trigger the checkout flow: #
Rabbitlala.checkout(
context,
paymentRef: 'your-generated-payment-reference',
);
βΉοΈ The
paymentRefis generated on your backend and passed to the SDK to trigger the RabbitLala checkout page.
πΌοΈ Demo #
Hereβs a quick look at the RabbitLala checkout experience:


πΌοΈ Example UI Integration #
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:rabitlala_flutter_sdk/rabbitlala.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
Rabbitlala.initialize(mode: Modes.demo);
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'RabbitLala Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xEC34C8DF)),
),
home: const MyHomePage(title: 'RabbitLala Demo'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final reference = TextEditingController(text: "PL-DDLLQ4QIXY");
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: Padding(
padding: const EdgeInsets.all(20),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
TextFormField(
controller: reference,
decoration: const InputDecoration(
labelText: "Reference",
border: OutlineInputBorder(),
),
),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
try {
Rabbitlala.checkout(
context,
paymentRef: reference.text,
).then((value) {
if (!context.mounted) return;
showDialog(
context: context,
builder: (_) => AlertDialog(
content: const Text("Checkout complete"),
),
);
});
} catch (e) {
log("Error launching checkout: $e");
}
},
child: const Text("Pay"),
),
],
),
),
),
);
}
}
π§Ύ License #
This project is licensed under the MIT License. See the LICENSE file for details.
π Support #
- Website: https://rabbitlala.ng
- Email: support@rabbitlala.ng