← Selected work
PAYMENTS & PIX / PUB.DEV / PACKAGE STUDY
br_code_pix

Zero-native-dependency Brazilian Pix EMV QR payloads for Dart.

A pure Dart and Flutter package strictly implementing the Banco Central do Brasil BR Code manual for Static and Dynamic Pix payloads with CRC16-CCITT checksums and an out-of-the-box QR widget.

Dart & FlutterPix / BACENEMV QRpub.dev v1.0.0MIT

Published Dart & Flutter package architecture. Verified source, API documentation, and releases on pub.dev.

PACKAGE ENGINEERING

Strict BACEN EMV Pix payloads and QR rendering in pure Dart.

Brazil's instant payment network (Pix) relies on the Banco Central do Brasil (BCB) BR Code specification—an EMV Merchant-Presented QR format where a single malformed TLV length prefix or off-spec CRC16 checksum causes banking apps to reject a payment.

br_code_pix implements Static and Dynamic (Cob / CobV) BR Code generation directly in pure Dart, automating TLV field formatting, Brazilian Portuguese diacritic sanitization, field-length clamping, and strict CRC16-CCITT calculation.

With zero native platform dependencies, the library runs uniformly across Android, iOS, Web, macOS, Windows, Linux, and WebAssembly—and includes an out-of-the-box BrCodePixWidget for instant QR presentation in Flutter.

PUB.DEV VERSION1.0.0
PUB POINTS160 / 160
PLATFORMSAll 6 OS + Web
WASM READYYes (Zero Native Code)
STANDARDBCB BR Code / EMV QR
CHECKSUMCRC16-CCITT (0x1021)
DART SDK>=3.0.0 <4.0.0
LICENSEMIT
QUICK START & INTEGRATION

Drop-in installation and Dart API.

Published as br_code_pix on pub.dev (v1.0.0, published Feb 25, 2026) with 160 / 160 pub points.

BrCodePix & BrCodePixWidget — Static and Dynamic Pix PayloadsBCB EMV / CRC16-CCITT
pubspec.yaml
dependencies:
  br_code_pix: ^1.0.0
lib/main.dart
final staticPayload = BrCodePix.generateStatic(
  pixKey: '+5511999999999',
  merchantName: 'MINHA LOJA PIX',
  merchantCity: 'SAO PAULO',
  amount: 35.50,
  txid: 'PGTO123',
);

BrCodePixWidget.staticPix(
  pixKey: '+5511999999999',
  merchantName: 'MINHA LOJA PIX',
  merchantCity: 'SAO PAULO',
  amount: 35.50,
);
01. Payload Strings or Drop-In QR Widget. Generate raw EMV strings for copy-and-paste ('Pix Copia e Cola') or drop BrCodePixWidget.staticPix / dynamicPix directly into Flutter checkout screens with optional centered brand logos.
TECHNICAL ARCHITECTURE

Precision EMV formatting without bloat.

Deterministic TLV field serialization, diacritic normalization, and mathematical CRC16 verification following BCB rules.

01

Strict ID + Length + Value Serialization

EmvUtil.formatField encodes every EMV tag using two-digit zero-padded lengths—assembling Payload Format (00), Pix GUI br.gov.bcb.pix (26), MCC (52), BRL currency 986 (53), optional amount (54), country BR (58), and TXID template (62).

02

BACEN CRC16-CCITT Verification

Crc16.calculate computes the 16-bit checksum across the complete payload plus tag 6304 using polynomial 0x1021 and initial value 0xFFFF, formatting uppercase 4-hex digits guaranteed to pass bank QR scanners.

03

Static & Dynamic (Cob / CobV) Flows

Supports static charges with CPF, CNPJ, email, phone, or EVP random keys as well as dynamic PSP payload URLs (strip scheme into subfield 26-25 with '***' TXID per BACEN spec 2.6.1).

04

ASCII Sanitization & Flutter QR Widget

EmvUtil.sanitizeStr normalizes Portuguese accents, strips unsupported punctuation, uppercases, and clamps merchant names (25 chars) and cities (15 chars). BrCodePixWidget wraps qr_flutter with custom colors and embedded logo support.

EMV SPECIFICATION & API

Supported Modes, Fields & Targets

160 / 160 PUB POINTS
EMV / PIX FIELDS
  • Tag 00: Payload Format Indicator ('01')
  • Tag 26: br.gov.bcb.pix (Key 01 or URL 25)
  • Tags 52–58: MCC 0000, Currency 986 (BRL), BR
  • Tags 59–60: Sanitized Merchant Name & City
  • Tags 62 & 63: TXID Reference & CRC16-CCITT
PUBLIC DART API
  • BrCodePix.generateStatic(...)
  • BrCodePix.generateDynamic(...)
  • BrCodePixWidget & .staticPix / .dynamicPix
  • Crc16.calculate(payload)
  • EmvUtil.formatField & EmvUtil.sanitizeStr
RUNTIME TARGETS
  • Android & iOS mobile apps
  • Web & WebAssembly (is:wasm-ready)
  • macOS, Windows & Linux desktop
  • Zero native C++ or platform channels
  • Depends only on Flutter + qr_flutter ^4.1.0
OPEN SOURCE & VERIFIED PUBLISHER

Maintained under devflier.com.

br_code_pix is open source under the MIT License and published on pub.dev with full Dart 3 and WebAssembly compatibility.

EXPLORE PACKAGE@lucasveneno/trafficbotEXPLORE PLATFORMAutomotive DTC Codes PlatformEXPLORE PACKAGEBTC & Altcoins Trend IndicatorEXPLORE PACKAGESignal Dashboard: Traffic Light Panel
LET’S BUILD WHAT’S NEXTIDEA → PRODUCTION

Have something
worth building?

Tell us what you’re working on.

Start a conversation

New product · Existing platform · Engineering partnership · Technical challenge