feature/supa_avatar
What kind of change does this PR introduce?
- [x] ✨ Feature: Add
SupaAvatarwidget for displaying & editing user profile avatars. - [x] 📝 Documentation: Include full usage and customization guide in README.
- [x] 🔧 Refactor: Restructure example app folders for clarity & modularity.
- [x] 🚦 Routing: Add
go_routerwith route redirection based on Supabase auth state. - [ ] 🐛 Bugfix
- [ ] ✅ Test updates
What is the current behavior?
- No reusable avatar upload component for Supabase users.
- Example app has a flat and less scalable structure.
- No route redirection based on user auth session.
What is the new behavior?
🖼️ SupaAvatar Widget
- Readonly & editable avatar display
- Upload, override, and delete from Supabase Storage
- Customizable metadata key (
avatar_urlby default) - Cache-busting for real-time UI updates
- Bottom sheet for picking or removing avatar
- Configurable design via props
🗂️ Refactored Folder Structure of example app
Organized example app into:
lib/
└── src/
├── core/ # App config and shared constants
│ └── app_router.dart
└── views/ # Screens: SignIn, Home, etc.
🔐 Auth-Aware Routing
- Redirects to
/sign_in_upif user is signed out - Redirects to
/if user is signed in
Additional context
Usage
SupaAvatar(
radius: 48,
isEditable: true,
supabaseStoragePath: 'profile',
)
Added: Editor Type (modal or dialog),
Shows username or email initials while the image is loading using my own package ui_avatar,
Much more to come.
fix the ui of avatar editor to clean & simple.
| dialog | modal |
|---|---|
Hey Team, any comments or feedback? I am planning to build more flutter ui components for supabase, like firebase has for storage, database & many more.
I love the changes you made here. It really adds to the functionality of the Auth UI
I love the changes you made here. It really adds to the functionality of the Auth UI
Yeah. I wanted to create more UI features for supabase. I was very excited when I started working on it but no one replied for 3 months & I got disappointed. But this morning I saw this comment & really made my day. Kindly let me know if I should work on more UI features for flutter sdk?
Its a pleasure my brother.
I think it would be great if you could do that.
I am not sure what is happening in supabase_community as I currently have two open PRs in the mock_supabase_http_client package since March. https://github.com/supabase-community/mock_supabase_http_client/pull/20 https://github.com/supabase-community/mock_supabase_http_client/pull/22
It can get disappointing when you are trying to help and then no response.
If you are up for it, we can create a fork to maintain and grow. If this package starts to get maintained regularly once again we can always merge back into the main repository. But, in that way we can help the community at large while the supabase_community maintainers tackle the issues they deem higher priority.