healthrian_render_canvas 0.0.1 copy "healthrian_render_canvas: ^0.0.1" to clipboard
healthrian_render_canvas: ^0.0.1 copied to clipboard

A library to render JSON descriptions onto a Canvas.

healthrian_render_canvas #

A library to render JSON descriptions onto a Canvas.

This package provides the HealthrianRenderCanvas class, which takes a JSON map describing drawing elements (rectangles, text, lines, etc.) and renders them into a PNG image (Uint8List).

Features #

  • Parse JSON drawing instructions.
  • Support for:
    • Rectangles
    • Text (with custom fonts and weights)
    • Lines and Polylines
    • Circles
    • ECG grids/waveforms
    • Images (Base64 encoded)
  • Output to Uint8List (PNG format).

Usage #

import 'package:healthrian_render_canvas/healthrian_render_canvas.dart';

final canvas = HealthrianRenderCanvas(width: 2480, height: 3508); // A4 300dpi example
final jsonData = {
  'document': {
    'layers': [
      {
        'elements': [
          {
            'type': 'rectangle',
            'x': 10,
            'y': 10,
            'width': 100,
            'height': 50,
            'fill': '#FF0000'
          }
        ]
      }
    ]
  }
};

final pngBytes = await canvas.render(jsonData);
0
likes
160
points
104
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A library to render JSON descriptions onto a Canvas.

Repository (GitHub)

License

MIT (license)

Dependencies

flutter

More

Packages that depend on healthrian_render_canvas