Qris Dinamis
Convert static QRIS (Quick Response Code Indonesian Standard) to dynamic QRIS. Pure Dart — works on Flutter, server-side Dart, and CLI.
Features
- Convert static QRIS to dynamic — with or without image output
- Parse QRIS data — extract merchant name, NMID, NNS, etc.
- CRC-16 validation — verify QRIS checksum integrity
Installation
dependencies:
qris_dinamis: ^1.0.0
dart pub get
Usage
All functionality is accessed through a single QrisDinamis class:
import 'package:qris_dinamis/qris_dinamis.dart';
final qris = QrisDinamis('00020101021126570011ID........');
Convert to Dynamic QRIS (String Only)
final result = qris.convertFromStatic(nominal: '50000');
print(result.qrisString); // Dynamic QRIS string
print(result.imageBytes); // null
Convert to Dynamic QRIS (With Image)
final result = qris.convertFromStatic(
nominal: '50000',
withImage: true,
);
print(result.qrisString); // Dynamic QRIS string
File('output.png').writeAsBytesSync(result.imageBytes!); // PNG image
Convert with Template Overlay
final template = File('template.png').readAsBytesSync();
final result = qris.convertFromStatic(
nominal: '50000',
withImage: true,
templateImage: template,
);
Convert with Tax/Fee
// Percentage fee
final result = qris.convertFromStatic(
nominal: '50000',
taxType: 'p',
fee: '10',
);
// Fixed rupiah fee
final result = qris.convertFromStatic(
nominal: '50000',
taxType: 'r',
fee: '1000',
);
Parse QRIS Data
final data = qris.parse();
print(data.merchantName); // Merchant name
print(data.nmid); // National Merchant ID
print(data.nns); // National Number System
print(data.crcIsValid); // CRC validation result
Validate CRC
print(qris.isCrcValid); // true or false
convertFromStatic() Parameters
| Parameter | Required | Description |
|---|---|---|
nominal |
✅ | Transaction amount |
taxType |
❌ | 'p' for percentage, 'r' for rupiah (default: 'p') |
fee |
❌ | Fee amount (default: '0') |
withImage |
❌ | Generate PNG image (default: false) |
templateImage |
❌ | Template image bytes for overlay |
qrSize |
❌ | QR code size in pixels (default: 400) |
qrMargin |
❌ | QR code margin in modules (default: 2) |
Credits
Based on Qris-Dinamis by Rachma Azis.
License
MIT
Support
Libraries
- qris_dinamis
- QRIS Dinamis — Convert static QRIS to dynamic QRIS.
