midtrans_snap 1.0.0 midtrans_snap: ^1.0.0 copied to clipboard
Unofficial midtrans package. This package only supports the snap token flow.
Midtrans Snap #
Unofficial midtrans package. This package only supports the snap token flow.
Usage #
-
Add
midtrans_snap
as a dependency in your pubspec.yaml.dependencies: midtrans_snap: latest
-
Install it
flutter pub get
-
And use it
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()); }, ), ), ));