feat: Support WebP image uploads, correct JPG MIME type, and refine professional rating display logic.
This commit is contained in:
@@ -278,8 +278,8 @@ class _ProfileSettingsTabState extends ConsumerState<ProfileSettingsTab> {
|
||||
if (picked == null) return;
|
||||
|
||||
final ext = picked.path.split('.').last.toLowerCase();
|
||||
if (!['jpg', 'jpeg', 'png', 'gif'].contains(ext)) {
|
||||
if (mounted) _showSnackBar('Please select a JPEG, PNG, or GIF image', isError: true);
|
||||
if (!['jpg', 'jpeg', 'png', 'webp'].contains(ext)) {
|
||||
if (mounted) _showSnackBar('Please select a JPEG, PNG, or WebP image', isError: true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -297,7 +297,8 @@ class _ProfileSettingsTabState extends ConsumerState<ProfileSettingsTab> {
|
||||
try {
|
||||
final profileState = ref.read(profileProvider);
|
||||
final role = profileState.isAgent ? 'AGENT' : 'USER';
|
||||
final contentType = 'image/$ext';
|
||||
final mimeExt = ext == 'jpg' ? 'jpeg' : ext;
|
||||
final contentType = 'image/$mimeExt';
|
||||
final fileName = picked.name;
|
||||
final repo = ProfileRepository();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user