🐇 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 paymentRef is 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:

RabbitLala Checkout Demo 1

RabbitLala Checkout Demo 2


🖼️ 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((status) {
                      log("status":"$status");
                      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"),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

📦 Payment Status Reference

Here’s what each value means:

Status Description
success Payment was completed and received successfully.
pending Payment is pending. A webhook will be sent to your server if it completes.
processed Payment was previously handled, either as success or failed.
null User abandoned the process or closed the SDK without completing payment.

🧾 License

This project is licensed under the MIT License. See the LICENSE file for details.


📞 Support

Libraries

features/auth/auth
features/auth/models/transaction_model
features/auth/repo/auth_repository
features/auth/service/auth_service
features/auth/UI/auth_home_ui
features/kyc/kyc
features/kyc/models/kyc_document_model
features/kyc/models/kyc_verification_model
features/kyc/repo/kyc_local_repo
features/kyc/repo/kyc_remote_repo
features/kyc/UI/kyc_ui
features/kyc/UI/src/kyc_textfield_loader
features/kyc/UI/src/successfully_verified
features/payment/payment
features/payment/payment_methods
features/payment/payment_successful
features/payment/src/card-payment/models/card_bank_data
features/payment/src/card-payment/repositories/card_repository
features/payment/src/card-payment/repositories/local
features/payment/src/card-payment/services/card_service
features/payment/src/card-payment/services/country_service
features/payment/src/card-payment/UI/card_home_ui
features/payment/src/card-payment/UI/src/bank_auth
features/payment/src/models/payment_model
features/payment/src/transfer-payment/models/bank_account_model
features/payment/src/transfer-payment/repo/transfer_repo
features/payment/src/transfer-payment/service/transfer_service
features/payment/src/transfer-payment/UI/transfer_home_ui
features/payment/src/wallet-payment/UI/wallet_home_ui
features/utility-bills/airtime-and-data/airtime_data
features/utility-bills/airtime-and-data/models/data_plan_model
features/utility-bills/airtime-and-data/repo/airtime_data_local_repo
features/utility-bills/airtime-and-data/service/_airtime_and_data_state
features/utility-bills/airtime-and-data/service/airtime_and_data_service
features/utility-bills/airtime-and-data/UI/airtime_and_data_home
features/utility-bills/electricity-bill/repo/electricity_local_repo
features/utility-bills/electricity-bill/service/electricity_service
features/utility-bills/electricity-bill/UI/electricity_home_ui
features/utility-bills/internet/repo/internet_local_repo
features/utility-bills/internet/service/internet_service
features/utility-bills/internet/UI/internet_home_ui
features/utility-bills/pick_service
features/utility-bills/tv/repo/tv_local_repo
features/utility-bills/tv/service/tv_service
features/utility-bills/tv/UI/tv_home_ui
features/utility-bills/utility_bills
features/websocket/websocket_cubit
features/websocket/websocket_state
global-widgets/global_widgets
global-widgets/src/page_indicator
interfaces/auth
interfaces/auth_repo
interfaces/payment
main
rabbitlala
utils/clipboard/copy_clipboard
utils/clipboard/copy_clipboard_mobile
utils/src/_global_images
utils/src/loader_message_model
utils/src/show_custom_toast
utils/utils_export