
Hey everyone! 👋
I’m excited to share something I’ve been working on — ui_guard, a Flutter package that makes it simple to control what parts of your UI users can see, based on roles, permissions, or custom conditions.
Whether you're building an admin dashboard, a subscription-based app, or just want cleaner access control logic — ui_guard helps you build secure, access-aware interfaces entirely in Dart. 💡
https://pub.dev/packages/ui_guard
✨ What makes ui_guard special?
✅ Guard widgets or full screens based on user roles
🧩 Combine multiple roles, permissions, or runtime conditions
🧪 Use Developer Override mode for UI testing
🔄 Update user roles at runtime without hassle
♻️ Works with any state management approach — Bloc, Riverpod, Provider, etc.
📦 No platform dependencies — 100% Dart!
💬 Common use cases
Show settings only to admins
Display upgrade prompts to free users
Hide premium features for unsubscribed users
Customize widgets dynamically based on user type
⚙️ Why I built this
After running into messy, scattered access logic in multiple projects, I wanted a cleaner way to handle UI restrictions. ui_guard was born from that need — and I made it open-source to help other developers avoid the same headaches.
If you're building Flutter apps that need any kind of UI access control — check it out!
And if you find it useful, a coffee ☕ goes a long way in helping me improve and support this project further.
Thanks for reading — and stay tuned for more Flutter tools! 🚀
— Tanvirul
