
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Welcome to Neostate! ๐ A lightweight and intuitive library for managing shared states in Flet applications. With StateCraft, you can bind widgets to a shared state effortlessly, enabling seamless updates across your UI components with minimal boilerplate.
Neostate
is a package designed to simplify and optimize state management in Flet
apps. It provides a clean and easy way to handle global and scoped states, allowing you to build apps with a simpler and more powerful state management system.
Elegant Routing ,State Management & More for Flet Applications
Welcome to Neostate! ๐ A lightweight and intuitive library for managing shared states in Flet applications,Use routing with Ease and much more, With Neostate, you can bind widgets to a shared state effortlessly, enabling seamless updates across your UI components with minimal boilerplate.
Install the package from PyPI:
pip install Neostate
What is it?
Think of StateNotifier like a magic box where we store important information, like a score in a game. When the score changes, it shouts out to everyone that it's been updated!
How it works:
Fun part ๐: You can add or remove listeners, like telling certain parts of the app to pay attention when the score changes.
Shared
class to bind Flet widgets dynamically to shared states.content
, value
, or controls
dynamically.shared_state.value += 1
.What is it?
Imagine you have a cool widget (like a score display) and you want it to automatically change when the score updates. Shared makes this happen!
How it works:
Whatโs special ๐ซ:
Itโs like a team where one member holds the information (StateNotifier) and the other makes sure everything looks correct and up-to-date (Shared).
And thatโs how you make your app super interactive! ๐ฎ
Let me know if you'd like more details or adjustments! ๐๐
Basic routing allows you to manage navigation between pages in a simple way, using predefined methods like swap
, reach
, back
, and refresh
.
here function means : the function which return ui like return [ft.Container(height=100) ]
To activate Basic Routing, you just need to call the app with advanced_routing=False
:
enhanced_app(target, advanced_routing=False)
Example:
def home_page(page):
return Column([Text("Welcome to Home!")])
def about_page(page):
return Column([Text("About Us")])
# Basic Routing with swap and reach methods
page.swap("/home", home_page)
page.reach("/about", about_page)
Advanced routing gives you more control by using RoutingConfig
to register routes, middlewares, and error pages. This mode is ideal for complex applications where you need more flexibility.
To activate Advanced Routing, you call the app with advanced_routing=True
:
enhanced_app(target, advanced_routing=True)
Example:
page.register_route("/home", home_page)
page.register_route("/about", about_page)
page.set_global_error_page("404", page_not_found)
page.register_middleware(auth_middleware)
You can easily switch between Basic and Advanced routing modes:
For Basic Routing, set advanced_routing=False
:
enhanced_app(target, advanced_routing=False)
For Advanced Routing, set advanced_routing=True
:
enhanced_app(target, advanced_routing=True)
When to Choose Which? ๐ค
๐ Basic Routing: Best for mobile and desktop apps, providing simple and fast navigation.
๐๏ธ Advanced Routing: Perfect for websites and web apps, supporting complex setups with middleware and role-based access.
Hereโs the updated changelog with the emojis added back in:
๐ ๏ธ Neostate App Creation Command
Creating a new app template is now easier than ever! Use the neostate create appname
command in the terminal to generate your app structure. Here's the generated directory structure:
<appname>/
โโโ assets/
โ โโโ fonts/
โ โโโ images/
โโโ App/
โ โโโ components/
โ โโโ pages/
โ โโโ services/
โ โโโ state/
โ โโโ utils/
โ โโโ main.py
โโโ main.py
โโโ requirements.txt
โโโ README.md
Neostate create <appname>
<appname>
can be anything like firstapp
Center
widget to simplify centering any widget. Whether it's a Column
, Row
, or Container
simply wrap it with Center(ft.column([]))
to achieve perfect centering. The force
and expand
arguments are optional.#usage
from Neostate Import Center
Center(ft.Column([]) #or can be any widget
)
force
and expand
, True or False can be passed , test it out yourselfEnjoy these new features to enhance your app development workflow!
FAQs
Welcome to Neostate! ๐ A lightweight and intuitive library for managing shared states in Flet applications. With StateCraft, you can bind widgets to a shared state effortlessly, enabling seamless updates across your UI components with minimal boilerplate.
We found that Neostate 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
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.