i am not able to stay on current page when i refresh or come to that page on browser #5024
pamraman2009
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i am not able to stay on current page when i refresh or come to that page on browser can anyone help so please help
login_page.py
import flet as ft
from flet import *
import requests
import asyncio
from multi_tabs import buildTabs
from admin_multi_tab import admin_buildTabs
from super_admin_multi_tab import super_admin_buildTabs
from icecream import ic
from api_url import login_url
class MyLogin(Column):
def init(self, page):
super().init()
self.username = ft.TextField(value='demo', width=280, height=40, hint_text='Login ID',
border='underline', color='black', prefix_icon=ft.icons.EMAIL)
self.password = ft.TextField(value='hello123', width=280, height=40, hint_text='Password',
border='underline', color='black', prefix_icon=ft.icons.LOCK, password=True)
self.page = page
self.page.on_keyboard_event = self.on_key_down
async def get_session_data(page: Page):
"""Retrieve session data from client_storage."""
try:
session_data = page.client_storage.get("session_data")
if session_data and session_data.get("value") == True:
ic("Session retrieved from client_storage---279---:", session_data)
return session_data
except Exception as e:
ic(f"Failed to retrieve session----283---: {e}")
ic("No valid session found-----284---.")
return None
def main(page: Page):
mylogin = MyLogin(page)
usr_page = buildTabs(page)
admin_page = admin_buildTabs(page)
super_admin_page = super_admin_buildTabs(page)
ft.app(host='192.168.31.131', port=8504, target=main,
view=AppView.WEB_BROWSER, assets_dir='assets')
Beta Was this translation helpful? Give feedback.
All reactions