Skip to content

Scaffold silvestre-flutter package with flutter_rust_bridge v2 #29

@enzoftware

Description

@enzoftware

Description

Create the Flutter package that wraps silvestre-core via flutter_rust_bridge v2, providing a native Dart API for image processing.

Context

The Flutter package uses flutter_rust_bridge v2 for codegen, generating Dart bindings from a Rust API layer. The Rust side lives in silvestre-flutter/rust/ and depends on silvestre-core.

Tasks

  • Create silvestre-flutter/ package scaffold with pubspec.yaml
  • Set up silvestre-flutter/rust/Cargo.toml depending on silvestre-core
  • Create silvestre-flutter/rust/src/api.rs — public API surface for bridge codegen
  • Configure flutter_rust_bridge v2 codegen (flutter_rust_bridge.yaml or equivalent)
  • Run codegen and verify Dart bindings are generated
  • Create silvestre-flutter/lib/silvestre.dart with high-level Dart API:
    final image = await Silvestre.loadImage(path);
    final result = await image.applyFilter(SilvestreFilter.canny());
    await result.save('output.png');
  • Platform directory stubs for android/, ios/, macos/, linux/, windows/

Acceptance Criteria

  • flutter_rust_bridge_codegen generate runs without errors
  • Generated Dart bindings compile
  • Dart API is idiomatic (async, named parameters, typed filter enums)
  • Package structure follows Flutter plugin conventions
  • flutter analyze passes with no errors

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions