Skip to content

Native JavaScript access in Flet apps #5200

@7576457

Description

@7576457

Duplicate Check

Describe the requested feature

Hi,

I've been working extensively with the charting features in Flet, and while they are a great start, I’ve encountered numerous bugs and limitations. From what I can tell, many of these issues stem from the underlying fl_chart package in Flutter.

Recently, I noticed that the process of importing Flutter packages into Flet has been updated. That inspired me to explore creating my own charting package for Flet. However, while investigating how to approach this, I realized something important: many Flutter chart packages (like the one I intended to use) are originally wrappers around JavaScript libraries — in my case, ECharts.

That made me question the necessity of this three-layer architecture — JavaScript → Flutter → Flet. Since Flet runs on top of Flutter, and Flutter sometimes wraps JS libraries, wouldn’t it be more efficient if Flet could interact with JavaScript directly (at least in web deployments)?

Back in issue #68, the team chose to go with fl_chart, which makes sense at that stage. But after spending a lot of time trying to make it work for more complex use cases, I found that something like ECharts offers far more flexibility and a rich set of features:
👉 https://echarts.apache.org/examples/en/index.html#chart-type-line
Suggestion

Would it be possible to allow running raw JavaScript code directly within Flet, starting with web builds? Even basic JS integration could unlock powerful use cases like advanced charting, animations, or third-party JS libraries — without relying solely on Flutter plugins.

I’m not sure how feasible this is from a technical standpoint, but I’d love to hear your thoughts on it.

Suggest a solution

No response

Screenshots

No response

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions