Skip to content

Conversation

@Alachi24
Copy link

@Alachi24 Alachi24 commented Oct 13, 2025

Summary

Refined and expanded the State Management docs for better clarity, accuracy, and developer onboarding. The section now provides more hands-on examples, clearer explanations, and improved structure while keeping the original tone and flow.

✅ Key Improvements

  • Simplified introduction to reactive state management
  • Clear comparison between static vs. reactive variables
  • Added progressive examples — from basic counter to controller-based setup
  • Expanded Controller, @obx, computed(), and watch/watch_multiple explanations
  • Included new sections on Reactive Lists/Dicts, Best Practices, and Troubleshooting
  • Unified formatting with tabs, tables, and consistent imports
  • Added performance tips and common pitfalls for beginners

⚙️ Fixes

  • Standardized code examples for immediate execution
  • Clarified .value usage and watcher behavior
  • Improved readability and consistency across examples

🚀 Outcome

  • Easier for new users to grasp FletX reactivity
  • Clean, testable examples ready to run
  • Stronger foundation for scaling future doc updates

No breaking changes.
Purely a documentation and structure improvement — ready for merge ✅
Closes #109


@Einswilli
Copy link
Contributor

Great @Alachi24 !
Can we have a preview link???

@Alachi24
Copy link
Author

It's kindly attached here @Einswilli

🔗 Preview Link: Updated State Management Docs

Copy link
Contributor

@Einswilli Einswilli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all, thank you so much for your contribution and your patience.

We would appreciate it if you could revise this documentation based on the feedback provided. The overall idea and structure are solid, but there are a few areas that need attention: some examples do not align with FletX’s APIs, there are references to non-existent methods, classes, or objects, certain functionalities are used incorrectly, and the documentation does not fully cover all aspects of state management with FletX.
We recommend taking a close look at the source code in fletx.core.state.py to see how it interacts with other components. Most importantly, please test the examples thoroughly and consider adding GIF previews to illustrate key points.

---

### 🔄 Why reactivity matters
**Requirements:**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seectioin is unnecessary, you can remove it.

---

## ⚖️ Static vs. Reactive Variables
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add more details (explanation) to this section.


```python
import flet as ft
from fletx import RxInt, obx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RxInt is under fletx.core and Obx widget is under fletx.widgets so import must be:

from fletx.core import RxInt
from fletx.widgets import Obx

---

### 📦 Built-in reactive types
## 🧮 Example 1 — Simple Counter App
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice to add a preview of this example

@Alachi24
Copy link
Author

@Einswilli Thank you for that feedback. The clarity gained has helped me improve where needed, and it has also added to my knowledge of FletX.

I’ve revised the examples to ensure they’re now fully functional and testable. Updates have been made to places that require it.
Here's the preview State-management.md

@Einswilli
Copy link
Contributor

Thanks @Alachi24 , i'll. reviiew it very soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the “State Management” section simpler, more pedagogical, and example-oriented

2 participants