flutter_rave 0.0.5

  • Readme
  • Changelog
  • Example
  • Installing
  • 72

Rave by Flutterwave Plugin for Flutter #

pub package

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.

Then initialize the plugin preferably in the initState of your widget.

import 'package:flutter_rave/flutter_rave.dart';

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Builder(
        builder: (context) => SingleChildScrollView(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.start,
                children: <Widget>[
                  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.

An example project 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. Remember to be as descriptive as possible.

[0.0.1] - 04-06-2019.

  • Initial release.

[0.0.2] - 06-06-2019.

  • Added Subaccount field.

[0.0.3] - 06-06-2019.

  • Bug Fixes

[0.0.4] - 09-06-2019.

  • Bug Fixes

[0.0.5] - 12-07-2019.

  • Bug Fixes

example/README.md

example #

A new Flutter project.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_rave: ^0.0.5

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_rave/flutter_rave.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
69
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
40
Overall:
Weighted score of the above. [more]
72
Learn more about scoring.

We analyzed this package on Nov 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/rave_provider.dart. (-1.49 points)

Analysis of lib/rave_provider.dart reported 3 hints:

line 500 col 30: This function has a return type of 'String', but doesn't end with a return statement.

line 572 col 30: This function has a return type of 'String', but doesn't end with a return statement.

line 592 col 30: This function has a return type of 'String', but doesn't end with a return statement.

Format lib/flutter_rave.dart.

Run flutter format to format lib/flutter_rave.dart.

Maintenance issues and suggestions

Support latest dependencies. (-50 points)

The version constraint in pubspec.yaml does not support the latest published versions for 5 dependencies (dio, dio_flutter_transformer, equatable, flutter_svg, intl).

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
crypto ^2.0.6 2.1.3
cupertino_icons ^0.1.2 0.1.2
dio ^2.1.0 2.2.2 3.0.4
dio_flutter_transformer ^2.0.10 2.0.10 3.0.2
equatable ^0.2.3 0.2.6 0.6.1
flushbar ^1.3.0 1.9.1
flutter 0.0.0
flutter_svg ^0.13.1 0.13.1 0.14.4
flutter_webview_plugin ^0.3.5 0.3.9+1
intl ^0.15.8 0.15.8 0.16.0
tripledes ^2.1.0 2.1.0
url_launcher ^5.0.2 5.2.5
webview_flutter ^0.3.9 0.3.15+1
Transitive dependencies
charcode 1.1.2
collection 1.14.11 1.14.12
convert 2.1.1
cookie_jar 1.0.1
meta 1.1.7 1.1.8
path 1.6.4
path_drawing 0.4.1
path_parsing 0.1.4
petitparser 2.4.0
sky_engine 0.0.99
typed_data 1.1.6
url_launcher_platform_interface 1.0.1
vector_math 2.0.8
xml 3.5.0
Dev dependencies
flutter_test