onSelectMedia method
Opens the gallery for the user to pick an image to send.
Implementation
Future<void> onSelectMedia() async {
try {
final selectedFile = await _picker.pickImage(source: ImageSource.gallery);
if (selectedFile != null) {
uploadPhoteChat(selectedFile);
}
} catch (error) {
if (kDebugMode) {
print("error selecting image from gallery ==> $error");
}
}
}