Skip to content

How to compile worker for flutter web? #79

Description

@bambinoua

I need to generate pdf using pdf package with using squadron worker.

I created a class as described:

@SquadronService(baseUrl: './worers', targetPlatform: TargetPlatform.web)
base class BdfBuilderWorker {
  @SquadronMethod
  Future<Unit8List> build(PdfBuilder builder) {
    return builder.build();
  }
}

I run dart builder and got required g.dart files

I tried to compile to js

dart compile js "pdf_builder_worker.web.g.dart" -o "pdf_builder_worker.web.g.dart.js"

but compilation starts to analyze fonts, other classes etc.. so compilation is failed. Can you give me advise how to compily ONLY single file to JS? Or how can I got the js file in other way?

document_5350698071565049624.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions