meld_core

pub package CI MIT license

Pure Dart geometry planning for Meld. It has no Flutter or platform dependency, so the same deterministic plan can run in Dart VM, isolates, servers, and Flutter applications.

Install

dependencies:
  meld_core: ^1.0.0
import 'package:meld_core/meld_core.dart';

const from = PathDataSource('M3 6H21M3 12H21M3 18H21');
const to = PathDataSource('M5 5L19 19M19 5L5 19');

final engine = MeldEngine();
final plan = engine.plan(from, to);
final frame = allocateOutputs(plan);
interpolatePlan(plan, 0.5, frame);

The engine handles SVG commands and primitives, viewBox fitting, arc-length sampling, subpath matching, topology-aware alignment, similarity transforms, spring stepping, bounded caches, diagnostics, and JSON plan serialization. Endpoint frames remain canonical while flight frames use reusable typed buffers. Set maxCacheBytes when an application needs a tighter memory budget; the retained byte estimate is available from engine.cacheStats.

Sources carry the paint intent used by Flutter's MeldPaintStyle.original: PathDataSource, GeometrySource, and CubicSource accept explicit MeldSourcePaintStyle values, while SvgMarkupSource derives fill, stroke, or both from inline SVG paint attributes unless overridden.

Libraries

meld_core