![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
FletX is a powerful routing and state management library for the Flet framework. It simplifies application development by separating UI and logic while providing intuitive navigation solutions.
FletX is a powerful dynamic routing
and global state management
library for the Flet framework. It simplifies application development by separating UI
and logic
while providing intuitive navigation solutions.
Add the FletX package to your project:
pip install fletx
Directory & File Structure
📦CounterApp
├── main.py
├── states
│ └── main_state.py
└── views
├── counter_view.py
└── home_view.py
main.py
import flet as ft
from fletx import Xapp,route
from states.main_state import MainState
from views.home_view import HomeView
from views.counter_view import CounterView
def main(page: ft.Page):
page.title = "FletX counter example"
Xapp(
page=page,
init_route="/",
state=MainState,
routes=[
route(route="/",view=HomeView),
route(route="/counter",view=CounterView),
]
)
ft.app(main)
states/main_state.py
import flet as ft
from fletx import Xstate
class MainState(Xstate):
def __init__(self, page):
super().__init__(page)
self.txt_number = ft.TextField(value="0", text_align=ft.TextAlign.RIGHT, width=100)
def minus_click(self,e):
self.txt_number.value = str(int(self.txt_number.value) - 1)
self.update()
def plus_click(self,e):
self.txt_number.value = str(int(self.txt_number.value) + 1)
self.update()
views/home_view.py
import flet as ft
from fletx import Xview
class HomeView(Xview):
def build(self):
return ft.View(
horizontal_alignment=ft.CrossAxisAlignment.CENTER,
vertical_alignment=ft.MainAxisAlignment.CENTER,
controls=[
ft.Text("Home View"),
ft.Text(f"Counts = {self.state.txt_number.value}"),
ft.ElevatedButton("Go Counter View",on_click=lambda e:self.go("/counter"))
]
)
views/counter_view.py
import flet as ft
from fletx import Xview
class CounterView(Xview):
def build(self):
return ft.View(
horizontal_alignment=ft.CrossAxisAlignment.CENTER,
vertical_alignment=ft.MainAxisAlignment.CENTER,
controls=[
ft.Row(
[
ft.IconButton(ft.Icons.REMOVE, on_click=self.state.minus_click),
self.state.txt_number,
ft.IconButton(ft.Icons.ADD, on_click=self.state.plus_click),
],
alignment=ft.MainAxisAlignment.CENTER,
),
ft.ElevatedButton("<< Back",on_click=self.back)
]
)
Found this repository helpful? Let us know!
FAQs
FletX is a powerful routing and state management library for the Flet framework. It simplifies application development by separating UI and logic while providing intuitive navigation solutions.
We found that fletx demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.