liquid_codegen 0.1.2 copy "liquid_codegen: ^0.1.2" to clipboard
liquid_codegen: ^0.1.2 copied to clipboard

Optional YAML → typed LiquidEvent codegen for liquid_analytics. Generates sealed-class compatible event classes with no build_runner required.

liquid_codegen #

Optional YAML → typed LiquidEvent generator for liquid_analytics. Compatible with the hand-written sealed-class API — no build_runner, no annotations at runtime.

Install (dev dependency) #

dev_dependencies:
  liquid_codegen: ^0.1.0

YAML schema #

# events.yaml
doc: Checkout and marketing events for the shop app.
events:
  checkout_started:
    category: analytics          # optional, default analytics
    properties:
      cart_value: double         # required
      is_gift: bool?             # optional (trailing ?)
  marketing_ping:
    category: marketing
    properties:
      campaign: String
  app_opened:                    # no properties

Generate #

dart run liquid_codegen -i events.yaml -o lib/analytics/events.g.dart

Use #

import 'package:liquid_analytics/liquid_analytics.dart';
import 'analytics/events.g.dart';

liquid.log(const CheckoutStarted(cartValue: 42, isGift: true));

Generated classes are plain LiquidEvent subclasses — same as writing them by hand.

0
likes
160
points
153
downloads

Documentation

API reference

Publisher

verified publisherketok.id

Weekly Downloads

Optional YAML → typed LiquidEvent codegen for liquid_analytics. Generates sealed-class compatible event classes with no build_runner required.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#analytics #codegen #flutter

License

MIT (license)

Dependencies

args, path, yaml

More

Packages that depend on liquid_codegen