u/Particular-Flan-202

I built a declarative ZPL layout engine for Flutter

I built a declarative ZPL layout engine for Flutter

hi i'm Farook. i just love building things for others.

lately, i’ve been shipping random things to see what sticks. the latest is zpl_kit.

if you’ve ever worked with zebra printers, you know it's hell. you’re stuck writing raw strings and doing manual coordinate math. if you move one text block, you have to recalculate everything else. it’s 2026, we shouldn't be doing math to print a label.

so, i built a declarative layout engine for it. i used vibe coding to speed through the initial architecture and it turned out great.

the architecture: it’s inspired by flutter’s own layout protocol:

  1. constraints down: parent tells child the max space available.
  2. sizes up: child calculates its size and reports back.
  3. compile: the engine takes those sizes and automatically injects the ^FO coordinates for you.

instead of raw ZPL strings, you build labels like this:

dartZplColumn(
  children: [
    ZplRow(
      children: [
        ZplExpanded(child: ZplText('SHIP FROM: $name')),
        ZplExpanded(child: ZplText('UPS', textAlign: ZplTextAlign.right)),
      ],
    ),
    ZplDivider(),
    ZplCenter(child: ZplBarcode('123456')),
  ],
)

it turns a 4-hour math session into a 5-minute UI build.

it's open source and i've been testing it on industrial GK420T printers. would love for you to try it and tell me where it breaks.

package: https://pub.dev/packages/zpl_kit 

u/Particular-Flan-202 — 9 hours ago