https://github.com/akacokafor/flutter_rave
Rave by Flutterwave
https://github.com/akacokafor/flutter_rave
flutter flutterwave flutterwave-rave
Last synced: 3 months ago
JSON representation
Rave by Flutterwave
- Host: GitHub
- URL: https://github.com/akacokafor/flutter_rave
- Owner: akacokafor
- License: apache-2.0
- Created: 2019-06-04T12:12:02.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-04-21T09:32:21.000Z (about 5 years ago)
- Last Synced: 2025-10-23T00:44:27.712Z (7 months ago)
- Topics: flutter, flutterwave, flutterwave-rave
- Language: Dart
- Size: 646 KB
- Stars: 7
- Watchers: 0
- Forks: 24
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Rave by Flutterwave Plugin for Flutter
[](https://pub.dartlang.org/packages/flutter_rave)
A Flutter plugin for making payments via Rave by Flutterwave Payment Gateway. Fully
supports Android and iOS.
## Installation
To use this plugin, add `flutter_rave` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).
Then initialize the plugin preferably in the `initState` of your widget.
``` dart
import 'package:flutter_rave/flutter_rave.dart';
class _MyHomePageState extends State {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Builder(
builder: (context) => SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
'Pay Me',
),
FlatButton.icon(
onPressed: () {
_pay(context);
},
icon: Icon(Icons.email),
label: Text("Pay"),
),
],
),
),
),
);
}
_pay(BuildContext context) {
final _rave = RaveCardPayment(
isDemo: true,
encKey: "c53e399709de57d42e2e36ca",
publicKey: "FLWPUBK-d97d92534644f21f8c50802f0ff44e02-X",
transactionRef: "SCH${DateTime.now().millisecondsSinceEpoch}",
amount: 100,
email: "demo1@example.com",
onSuccess: (response) {
print("$response");
print("Transaction Successful");
if (mounted) {
Scaffold.of(context).showSnackBar(
SnackBar(
content: Text("Transaction Sucessful!"),
backgroundColor: Colors.green,
duration: Duration(
seconds: 5,
),
),
);
}
},
onFailure: (err) {
print("$err");
print("Transaction failed");
},
onClosed: () {
print("Transaction closed");
},
context: context,
);
_rave.process();
}
}
```
No other configuration required—the plugin works out of the box.
## Running Example project
For help getting started with Flutter, view the online [documentation](https://flutter.io/).
An [example project](https://github.com/akacokafor/flutter_rave/tree/master/example) has been provided in this plugin.
Clone this repo and navigate to the **example** folder. Open it with a supported IDE or execute `flutter run` from that folder in terminal.
## Contributing, Issues and Bug Reports
The project is open to public contribution. Please feel very free to contribute.
Experienced an issue or want to report a bug? Please, [report it here](https://github.com/akacokafor/flutter_rave/issues). Remember to be as descriptive as possible.