flet
flet copied to clipboard
DeprecationWarning: Call to __init__()
DeprecationWarning: Call to init() is deprecated since version 0.21.0 and will be removed in version 1.0. UserControl is deprecated. See https://flet.dev/docs/getting-started/custom-controls. super().init()
meanwhile i cant see anything in the https://flet.dev/docs/getting-started/custom-controls and my app is not running too
Please fill up all details as required by the issue template.
As the message says, UserControl
is deprecated and will be removed in the future.
error is coming fro this class Main(UserControl): def init(self, page:Page,): super().init().. code was working until i upgraded flet... old flet version doent have some properties i required....and this error shows up when i try running my app
this is what i have...... from pages.forgotpassword import ForgotPassword from pages.login import Login from pages.signup import SignUp from pages.home import Home from flet import * class Main(UserControl): def init(self, page:Page): super().init() self.page = page self.page.title="Portal" self.page.horizontal_alignment=MainAxisAlignment.CENTER self.page.vertical_alignment=CrossAxisAlignment.CENTER #self.page.alignment=MainAxisAlignment.CENTER self.page.window_width=1800 self.page.window_height=1000 self.page.window_center=True self.page.padding=30
self.init_helper()
def init_helper(self,):
self.page.on_route_change = self.on_route_change
self.page.go('/')
def on_route_change(self, route):
newpage ={
"/":Home,
"/login":Login,
"/signup":SignUp,
"/forgotpassword":ForgotPassword
}[self.page.route](self.page)
self.page.views.clear()
self.page.views.append(
View(
route,
[newpage]
)
)
app(target=Main,assets_dir='assets')
Please build some reproducible code so we can test.
https://github.com/Philip-Leron/flet_portal