-
Notifications
You must be signed in to change notification settings - Fork 26
Description
The Controllers section of the documentation is currently too dense and technical, which can be intimidating for new users. While it explains the concept well, it lacks progressive explanations and practical examples to show how and when to use controllers effectively within a FletX app.
To make it more beginner-friendly and intuitive, this part should be rewritten with a smoother learning curve and more real-world examples.
Suggested improvements:
-
Start by explaining what a Controller is in FletX and why it’s central to the app’s architecture.
-
Show how a Controller acts as the bridge between the UI (FletXPage) and the business logic/state.
-
Provide step-by-step examples:
- A simple
CounterControllerwith one reactive variable. - A more advanced Controller managing multiple reactive states or async operations.
- Demonstrate communication between multiple Controllers (e.g.,
AuthController,UserController).
- A simple
-
Clarify lifecycle methods (
on_init,on_ready,on_close, etc.) and their use cases. -
Illustrate how dependency injection works with Controllers and how to register or retrieve them easily.
-
Add tips on best practices:
- Keeping logic out of the UI layer.
- Using Controllers for testability and scalability.
- Organizing Controllers in large applications.
Goal:
Make the Controllers section easier to grasp, more practical, and progressively detailed — helping users understand how Controllers simplify state and logic management in FletX.