midtrans_snap 1.0.1 midtrans_snap: ^1.0.1 copied to clipboard
Unofficial midtrans package. This package only supports the snap token flow.
import 'package:flutter/material.dart';
import 'package:midtrans_snap/midtrans_snap.dart';
import 'package:midtrans_snap/models.dart';
main() => runApp(MaterialApp(
home: Scaffold(
body: MidtransSnap(
mode: MidtransEnvironment.sandbox,
token: 'SNAP_TOKEN',
midtransClientKey: 'CLIENT_KEY',
onPageFinished: (url) {
print(url);
},
onPageStarted: (url) {
print(url);
},
onResponse: (result) {
print(result.toJson());
},
),
),
));