flet icon indicating copy to clipboard operation
flet copied to clipboard

feature: declarative support update from service

Open SamYuan1990 opened this issue 2 months ago • 2 comments

Duplicate Check

  • [x] I have searched the opened issues and there are no duplicates

Describe the requested feature

when we design a component, it may receive value update from a service. or in general case, https://docs.flet.dev/cookbook/declarative-vs-imperative-crud-app/#3-pageupdate-everywhere-nowhere when we replace page.update(), we can't replace

    page.horizontal_alignment = ft.CrossAxisAlignment.CENTER
    page.appbar = ft.AppBar(title=ft.Text("flet sherpa onnx"), center_title=True)
    fso_service = fso.FletSherpaOnnx()
    page._services.append(fso_service)

which causes page still a dependency of component and further cause error.

Suggest a solution

No response

Screenshots

No response

Additional details

No response

SamYuan1990 avatar Oct 23 '25 07:10 SamYuan1990

You mean adding service instance to a page, like:

ft.context.page.services.append(fso_service)

FeodorFitsner avatar Dec 16 '25 23:12 FeodorFitsner

You mean adding service instance to a page, like:

ft.context.page.services.append(fso_service)

one step further, after the service ready. if there any event of data stream from fso_service? how to handle this case?

SamYuan1990 avatar Dec 17 '25 01:12 SamYuan1990