-
Questioni tried using scroll_to method for row but it didn't work Code sampleimport flet as ft
async def main(page: ft.Page):
def scroll_auto(i):
controllers.scroll_to(offset=100,duration=1000)
page.horizontal_alignment = ft.CrossAxisAlignment.CENTER
#---------------------------------------------navigation bar(footer)------------------------------------------------------------
page.navigation_bar = ft.NavigationBar(
destinations=[
ft.NavigationDestination(
icon=ft.icons.HOME_OUTLINED,
selected_icon=ft.icons.HOME_ROUNDED,
label="Home"
),
ft.NavigationDestination(icon=ft.icons.COMMUTE, label="Commute"),
ft.NavigationDestination(
icon=ft.icons.ACCOUNT_CIRCLE_OUTLINED,
selected_icon=ft.icons.ACCOUNT_CIRCLE_ROUNDED,
label="Account",
),
]
)
#---------------------------------------------------------end----------------------------------------------------------------------
#---------------------------------------------Plug and Play Logo(header)------------------------------------------------------------
#---------------------------------------------------------end----------------------------------------------------------------------
#---------------------------------------------body------------------------------------------------------------
controllers=ft.Row(controls=[ft.Container(width=120, height=120, border_radius=15, bgcolor=ft.colors.GREEN_200, ink=True, on_click=scroll_auto),
ft.Container(width=120, height=120, border_radius=15, bgcolor=ft.colors.GREEN_200, ink=True, on_click=lambda e:print("hello world")),
ft.Container(width=120, height=120, border_radius=15, bgcolor=ft.colors.GREEN_200, ink=True, on_click=lambda e:print("hello world")),
ft.Container(width=120, height=120, border_radius=15, bgcolor=ft.colors.GREEN_200, ink=True, on_click=lambda e:print("hello world")),
], scroll="auto")
hot_deals_label=ft.Text(value="Hot Deals", size=20, color="#062A70", weight=ft.FontWeight.BOLD,)
body=ft.Column(controls=[ft.Text(),
ft.Row(controls=[hot_deals_label], alignment="center"),
controllers,
], width=400,spacing=50)
await page.add_async(body)
#----------------------------------------------end---------------------------------------------------------------------------------
ft.app(target=main, view=ft.WEB_BROWSER) Error messageAttributeError: 'Row' object has no attribute 'scroll_to' ------------------------------------------------------
|
Beta Was this translation helpful? Give feedback.
Answered by
plugeit
Oct 4, 2023
Replies: 1 comment 3 replies
-
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
but when doing it with async app it simply says not implemented raises a not implemented error