Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not picking up multiple images file on real device image gallery but on Google photos its working #1300

Closed
joshua750 opened this issue Jun 2, 2023 · 3 comments
Labels
new issue An issue that hasn't yet been seen from the maintainer stale

Comments

@joshua750
Copy link

joshua750 commented Jun 2, 2023

Hello its not pickup multiple images on real devices but on android emulator its working fine my real device is real me c3 android version 10 i guess it only working on google photos not phone gallery

Future pickImage() async {
try {
// Request permission to access storage
await Permission.storage.request();

  final result = await FilePicker.platform.pickFiles(
    allowMultiple: true,
    type: FileType.image,
  );

  if (result != null && result.files.isNotEmpty) {
    final appDir = await getApplicationDocumentsDirectory();
    final imagesDir = Directory('${appDir.path}/images');
    if (!await imagesDir.exists()) {
      await imagesDir.create(recursive: true);
      print('Created directory: $imagesDir');
    }

    for (var file in result.files) {
      final fileName = file.name;
      final filePath = file.path;
      final newPath = '${imagesDir.path}/$fileName';

      print('This filepath $filePath');
      // Move the image file to the images directory
      final File sourceFile = File(filePath!);
      final File destinationFile = await sourceFile.copy(newPath);

      print('Moved image: ${destinationFile.path}');

      await sourceFile.delete();
      print('Deleted image: $filePath');
    }

    refreshScreen();
  }
} catch (e) {
  print('Error picking images: $e');
}

}

@joshua750 joshua750 added the new issue An issue that hasn't yet been seen from the maintainer label Jun 2, 2023
@joshua750 joshua750 changed the title Not picking up multiple file on real device Not picking up multiple images file on real device Jun 2, 2023
@joshua750 joshua750 changed the title Not picking up multiple images file on real device Not picking up multiple images file on real device image gallery but on Google photos its working Jun 2, 2023
@github-actions
Copy link

This issue is stale because it has been open for 14 days with no activity.

@github-actions
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

@DarenF-20C
Copy link

DarenF-20C commented Feb 21, 2024

Facing this issue too, happens on some OS built-in gallery app.
Google's Photos won't have the issue.

So far tested,

  1. Vivo (Funtouch OS, Android 13) built-in gallery, Albums.
  2. Oppo (ColorOS 11.1, Android 11) built-in gallery, Photos (same name with google one but different icon).
  3. XiaoMi (Android 12) built-in FileManager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new issue An issue that hasn't yet been seen from the maintainer stale
Projects
None yet
Development

No branches or pull requests

2 participants