flutter-auth-ui icon indicating copy to clipboard operation
flutter-auth-ui copied to clipboard

feature/supa_avatar

Open 0xharkirat opened this issue 8 months ago • 6 comments

What kind of change does this PR introduce?

  • [x] ✨ Feature: Add SupaAvatar widget 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_router with 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_url by default)
  • Cache-busting for real-time UI updates
  • Bottom sheet for picking or removing avatar
  • Configurable design via props

avatar-demo

🗂️ 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_up if user is signed out
  • Redirects to / if user is signed in

Additional context

Usage

SupaAvatar(
  radius: 48,
  isEditable: true,
  supabaseStoragePath: 'profile',
)

0xharkirat avatar Apr 14 '25 03:04 0xharkirat

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.

0415 (2)

0xharkirat avatar Apr 15 '25 04:04 0xharkirat

fix the ui of avatar editor to clean & simple.

dialog modal
Simulator Screenshot - iPhone 15 Pro - 2025-04-15 at 14 56 50 Simulator Screenshot - iPhone 15 Pro - 2025-04-15 at 14 57 07

0xharkirat avatar Apr 15 '25 05:04 0xharkirat

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.

0xharkirat avatar Apr 21 '25 03:04 0xharkirat

I love the changes you made here. It really adds to the functionality of the Auth UI

jwelmac avatar Jul 24 '25 20:07 jwelmac

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?

0xharkirat avatar Jul 25 '25 00:07 0xharkirat

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.

jwelmac avatar Jul 25 '25 19:07 jwelmac