Skip to content

bug: Migration v0.28.3 to v.0.80.1 -- Custom class: self.page object has no setter #6006

@NiTRoeSE

Description

@NiTRoeSE

Duplicate Check

Describe the bug

Hello i try to migrate a big app with a lot of code from flet 0.28.3 to 0.80.1 and had the following issue:
To demonstrate i have created a simple example wich have exact the same behavior.
When i use the same class TestContent like in example in flet 0.80.1 the app throws the error self.page object has no setter

I´m a bit lost and wonder how i should write this stuff to work with flet 0.80.1 ?

Thanks in advanced!

Code sample

Code
##### working in flet 0.28.3

import flet as ft

class TestContent(ft.Container):
    def __init__(self, page:ft.Page):

        self.page = page
        super().__init__()
        
        self.content = ft.Column()
        self.content.controls.append(
            ft.Text(self.page.title)
        )


def main(page: ft.Page):

    page.title = "Test Content"
    content = TestContent(page)
    page.add(content)
    page.update()

ft.app(main)

To reproduce

Run code example in venv with flet 0.28.3 --> works.
Run code example in venv with flet 0.80.1 --> dont work.

Expected behavior

Should work in flet 0.80.1+

Screenshots / Videos

Captures Image

Operating System

macOS

Operating system details

26.0.1

Flet version

0.80.1

Regression

Yes, it used to work in a previous Flet version (please specify the version in additional details)

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

works in flet 0.28.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions