thai_promptpay_flutter 0.4.0
thai_promptpay_flutter: ^0.4.0 copied to clipboard
Flutter widgets that render a Thai PromptPay (EMVCo) QR code from a mobile number, National ID / Tax ID, e-Wallet or Bill Payment, with an optional amount.
Changelog #
0.4.0 #
- Add a decode side to the package (closes #1):
decodeThaiQr(String)→ sealedThaiQrResult(PromptPayResult|BillPaymentResult|SlipResult) — one call that recognizes a personal PromptPay, a Bill Payment, or a Slip Verify Mini-QR. Never throws; returnsnullif unrecognized.ThaiQrResultCard(+ThaiQrResultCard.fromPayload) — a Material widget that renders a decoded result (recipient/biller/bank, baht text, refs).PromptPayScanner— a camera scanner widget (viamobile_scanner) that reports aThaiQrResultthroughonResult; plusdecodeThaiQrFromImage.
- Bump
thai_promptpayto ^0.3.0 (adds Slip Verify decoding). - Requires Flutter >= 3.29 / Dart >= 3.7 now (a floor raised by
mobile_scanner7.x). Camera use needs platform setup — see the README.
0.3.4 #
- Docs: add a live web demo
(the example gallery deployed to GitHub Pages) and a workflow to keep it
updated. The gallery now builds for web (thanks to the
thainum^0.5.3 dart2js fix). No library changes.
0.3.3 #
- Docs: clarify the Thai tagline wording (สร้าง QR; เลขที่ผู้เสียภาษี). No code changes.
0.3.2 #
- Gallery example. The example is now a runnable gallery (mobile / desktop /
web) touring every widget — bare QR, QR card, live amount field, Bill
Payment QR + card — plus an interactive playground (pick a type, enter the
number/biller + amount → live QR + copyable payload) and a decode demo
(paste any payload → see who / how much via
decodeAny). TH/EN toggle. No library changes.
0.3.1 #
- Responsive cards (overflow fix).
PromptPayQrCardandPromptPayBillQrCardno longer throw aRenderFlex overflowedon small or narrow surfaces: the embedded QR is clamped to the available width and the content scrolls vertically when space is tight (via a shared internalResponsiveCardBody). In normal/roomy layouts the cards shrink-wrap and look exactly as before. No public API change.
0.3.0 #
PromptPayBillQr— renders a PromptPay Bill Payment (EMVCo tag 30) QR from a Biller ID + Ref1 (optional Ref2 + amount). MirrorsPromptPayQr: invalid input shows anerrorBuilder(or a default placeholder) instead of throwing, and apayloadgetter exposes the exact EMVCo string it renders.PromptPayBillQrCard— a drop-in Material card: the bill QR + a title, the Biller ID / Ref1 / Ref2 rows, and the amount as Thai baht text (viathainum).- Requires
thai_promptpay^0.2.0(the bill-payment codec). The new codec API (encodeBillPayment,decodeBillPayment,decodeAny,BillPaymentPayload) is re-exported.
0.2.0 #
PromptPayAmountField— a text field for entering a Thai baht amount, reporting the value as integer satang viaonChanged(null when empty). Restricts input to digits + at most two decimals, shows a฿prefix, and owns/disposes its controller safely. Wire it to aPromptPayQrfor a live "enter an amount" payment screen.BahtAmountInputFormatter+satangFromBahtString/bahtStringFromSatang— the exact (nodouble) baht↔satang helpers behind the field, exported for reuse.
0.1.0 #
Initial release. Flutter widgets for Thai PromptPay (EMVCo) QR codes, built on
the pure-Dart thai_promptpay codec
qr_flutter(andthainumfor baht text). Re-exports the codec.
PromptPayQr— renders the QR for a mobile number / National ID / e-Wallet, with an optional amount (integer satang). Convenience constructorsPromptPayQr.mobile/.nationalId/.eWallet. Invalid input shows anerrorBuilder(or a default placeholder) instead of throwing. Apayloadgetter exposes the exact EMVCo string the widget renders (for share/copy).PromptPayQrCard— a drop-in Material card: the QR + a title, the recipient, and the amount shown as Thai baht text (viathainum).