Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Flet: Flutter in Python
Search
Abdur-Rahmaan Janhangeer
April 15, 2023
Education
560
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Flet: Flutter in Python
Abdur-Rahmaan Janhangeer
April 15, 2023
More Decks by Abdur-Rahmaan Janhangeer
See All by Abdur-Rahmaan Janhangeer
Building AI Agents with Python: A Deep Dive
osdotsystem
0
97
Extending Flask using the Flask Plugins API
osdotsystem
0
170
PEPs that hit the front page
osdotsystem
0
170
The state of NLP in production 🥽
osdotsystem
0
210
libSQL: Taking Sqlite To The Moon
osdotsystem
0
270
Boosting Python With Rust 🚀
osdotsystem
0
250
SQLite Internals: How The World's Most Used Database Works
osdotsystem
2
3.8k
Fast Flask Dev For Big Codebases
osdotsystem
0
280
Python Bytecode or How Python Operates
osdotsystem
0
390
Other Decks in Education
See All in Education
AWS Skill Builderを活用した一石二鳥の業務計画
ysaeki
0
120
Center for Entrepreneurship Education | Science Tokyo (Institute of Science Tokyo)
sciencetokyo
PRO
0
210
AIがコードを書く時代に、何を教えるのか / What Should We Teach in the Age of AI-Generated Code?
ichiroc
1
450
チームの鏡になるー自分の癖を知ると、チームのパターンが見えてくる@スクフェス仙台
saorimurooka
0
130
プロポーザルを書く技術とアンチパターン/proposal-writing-and-antipatterns
moriyuya
13
3.7k
Throw Yourself In! - How I've learned English and What I'm Facing
georgeorge
1
220
Visionary Initiative: Future Intelligence 「未来の知性と社会の礎を築く」|Science Tokyo(東京科学大学)
sciencetokyo
PRO
0
1.2k
[2026前期火5] 論理学(京都大学文学部 前期 第5回)「 ならばの問題演習・proof net・かつの規則」
yatabe
0
390
輻射安全管理系統2.0暨輻防e++學園平台說明會
aecrp
0
1.9k
プログラミング言語において文字列を複数行にわたって だらだらと記載するアレ
sapi_kawahara
0
190
Lectura 1 (PIT : Python Basico)
robintux
0
1k
Visionary Initiative: Materials-Positive Society — Evolving “Things,” empowering a positive society | Science Tokyo
sciencetokyo
PRO
0
180
Featured
See All Featured
Darren the Foodie - Storyboard
khoart
PRO
3
3.6k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.3k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Context Engineering - Making Every Token Count
addyosmani
9
1k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Abbi's Birthday
coloredviolet
3
9.3k
Navigating Weather and Climate Data
rabernat
0
470
Designing for Performance
lara
611
70k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
250
Balancing Empowerment & Direction
lara
6
1.2k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
950
Transcript
Flet: Techniques & Tips
2
Python Mauritius UserGroup (pymug) More info: mscc.mu/python-mauritius-usergroup-pymug/ Why Where codes
github.com/pymug share events twitter.com/pymugdotcom ping professionals linkedin.com/company/pymug all info pymug.com tell friends by like facebook.com/pymug 3
Abdur-Rahmaan Janhangeer Help people get into OpenSource People hire me
to work on Python projects https://www.compileralchemy.com 4
ssslides 5
Flet: Techniques & Tips 6
Overview 7
Codebase 8
Publish 9
Notes 10
11
12
Techniques 13
Skeleton import flet as ft def main(page: ft.Page): page.title =
"Window title" b = ft.TextButton("text") page.add(b) ft.app(target=main) 14
Events def button_clicked(e): ... button = ft.TextButton("text", on_click=button_clicked, data=0) 15
Update widget textfield.value = 'a' page.update(textfield) # page.update() 16
Routing 17
import flet as ft def main(page: ft.Page): page.title = "Routes
Example" def route_change(route): page.views.clear() page.views.append( ft.View( "/", [ ft.AppBar(title=ft.Text("Flet app"), bgcolor=ft.colors.SURFACE_VARIANT), ft.ElevatedButton("Visit Store", on_click=lambda _: page.go("/store")), ], ) ) if page.route == "/store": page.views.append( ft.View( "/store", [ ft.AppBar(title=ft.Text("Store"), bgcolor=ft.colors.SURFACE_VARIANT), ft.ElevatedButton("Go Home", on_click=lambda _: page.go("/")), ], ) ) page.update() def view_pop(view): page.views.pop() top_view = page.views[-1] page.go(top_view.route) page.on_route_change = route_change page.on_view_pop = view_pop page.go(page.route) ft.app(target=main, view=ft.WEB_BROWSER) 18
import flet as ft class View: url = '/page' elements
= [ ft.ElevatedButton(text="Elevated button"), ft.ElevatedButton(text="Elevated button") ] @classmethod def do_something(cls): ... @classmethod def view(cls): return ft.View( cls.url, cls.elements, ) 19
def main(page: ft.Page): page.title = "Routes Example" def route_change(route): page.views.clear()
page.views.append( ft.View( "/", [ ft.AppBar(title=ft.Text("Flet app"), bgcolor=ft.colors.SURFACE_VARIANT), ft.ElevatedButton("Visit Store", on_click=lambda _: page.go("/store")), ], ) ) if page.route == View.url: page.views.append( view.elements ) page.update() def view_pop(view): page.views.pop() top_view = page.views[-1] page.go(top_view.route) page.on_route_change = route_change page.on_view_pop = view_pop page.go(page.route) 20
Dev experience 21
Icons ft.icons.PAUSE_CIRCLE_FILLED_ROUNDED 22
Color ft.color.RED_400 23
Next in this session 24
Code an app based on one of the previous sessions
code 25
26