flutter_midtrans 0.0.1 copy "flutter_midtrans: ^0.0.1" to clipboard
flutter_midtrans: ^0.0.1 copied to clipboard

A new Flutter plugin wrapper for Midtrans payment gateway.

example/lib/main.dart

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

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  initState() {
    super.initState();
    Midtrans.initSdkFlow(clientKey: 'SB-Mid-client-Iz_s_TejyRkYDWxn');
  }

  void testTransaction() {
    final user =
        MidtransUser('Ardiansyah Putra', 'putraxor@gmail.com', 'putraxor-01');
    final transId = 'trans-01';
    final items = [MidtransItem('01', 'Premium', 100000, 1)];
    Midtrans.createTransaction(transId: transId, items: items, user: user);
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('Plugin example app'),
        ),
        body: new Center(
          child: new Text('Hello, Midtrans'),
        ),
      ),
    );
  }
}
1
likes
20
pub points
0%
popularity

Publisher

unverified uploader

A new Flutter plugin wrapper for Midtrans payment gateway.

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_midtrans