Refacto et clean
This commit is contained in:
@ -7,7 +7,7 @@ class BigLeftImageWidget extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color: AppColors.gris.withOpacity(0.1),
|
||||
color: AppColors.gris.withAlpha(26),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.zero,
|
||||
child: Image.asset(
|
||||
|
@ -15,12 +15,12 @@ class _ProfilePictureSelectorState extends State<ProfilePictureSelector> {
|
||||
bool _isHovering = false;
|
||||
|
||||
Future<void> _pickAndUploadImage() async {
|
||||
if (!context.mounted) return;
|
||||
final provider = Provider.of<LocalUserProvider>(context, listen: false);
|
||||
final ImagePicker picker = ImagePicker();
|
||||
final XFile? image = await picker.pickImage(source: ImageSource.gallery);
|
||||
if (image != null) {
|
||||
// Envoie l'image au provider
|
||||
await Provider.of<LocalUserProvider>(context, listen: false)
|
||||
.changeProfilePicture(image);
|
||||
if (image != null && context.mounted) {
|
||||
await provider.changeProfilePicture(image);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user