Skip to content

fix: comprehensive bug fixes for Android, iOS, and Dart#11

Closed
yowanda wants to merge 1 commit into
nusanet:masterfrom
yowanda:fix/comprehensive-bugfixes
Closed

fix: comprehensive bug fixes for Android, iOS, and Dart#11
yowanda wants to merge 1 commit into
nusanet:masterfrom
yowanda:fix/comprehensive-bugfixes

Conversation

@yowanda

@yowanda yowanda commented May 5, 2026

Copy link
Copy Markdown

Summary

Perbaikan menyeluruh untuk bug dan masalah di plugin ini, mencakup platform Android, iOS, dan Dart.

Changes

Critical Fixes

  1. Android: Replace deprecated FlutterRenderer.getBitmap() — Diganti dengan PixelCopy API (API 26+) yang modern, dengan fallback ke drawing cache untuk device lama. getBitmap() sudah dihapus di Flutter terbaru dan menyebabkan crash.

  2. Android: Proper error handlingresult.success(null) yang silent diganti dengan result.error() yang informatif, sehingga developer bisa tahu penyebab error.

  3. iOS: Fix date format bugmm (menit) diganti ke MM (bulan) di DateFormatter, mencegah filename collision dan nama file yang salah.

  4. iOS: Fix force unwrap crash — Triple force unwrap app.delegate!.window!!.rootViewController as! diganti dengan safe resolution yang support SceneDelegate (iOS 13+).

Medium Fixes

  1. Android: Remove WRITE_EXTERNAL_STORAGE permission — Tidak diperlukan karena file disimpan ke internal cache directory.

  2. Android: Remove deprecated setDrawingCacheEnabled — Deprecated sejak API 28, tidak melakukan apa-apa di Android 9+.

  3. Android: Remove useless reloadMedia()ACTION_MEDIA_SCANNER_SCAN_FILE tidak bisa mengakses cache directory dan deprecated di Android 10+.

  4. Android: Remove unused PixelListener class — Dead code yang tidak pernah digunakan.

  5. iOS: Update podspec — Version, summary, description, homepage, dan author diupdate dari placeholder default.

Minor Fixes

  1. Dart: Remove redundant constconst MethodChannel(const ...)const MethodChannel(...)

  2. README: Fix typoandroid;requestLegacyExternalStorageandroid:requestLegacyExternalStorage (semicolon → colon)

  3. Android: Remove duplicate importMethodChannel.Result diimport 2 kali.

Testing

  • Perubahan Android menggunakan PixelCopy API yang sudah terbukti stabil sejak API 26 (Android 8.0)
  • Fallback ke drawing cache untuk device dengan API < 26
  • iOS perubahan menggunakan connectedScenes API yang tersedia sejak iOS 13

- Android: Replace deprecated FlutterRenderer.getBitmap() with PixelCopy API (API 26+) with drawing cache fallback for older devices
- Android: Proper error handling via result.error() instead of silently returning null
- Android: Remove unnecessary WRITE_EXTERNAL_STORAGE permission (file saved to cache dir)
- Android: Remove deprecated setDrawingCacheEnabled and useless reloadMedia() for cache dir
- Android: Remove unused PixelListener class (dead code)
- Android: Remove duplicate import and unused imports
- iOS: Fix date format bug (mm -> MM) causing incorrect month in filenames
- iOS: Fix force unwrap crash by safely resolving rootViewController with SceneDelegate support (iOS 13+)
- iOS: Update podspec with correct version, description, homepage, and author
- Dart: Remove redundant const in MethodChannel constructor
- README: Fix typo semicolon -> colon in requestLegacyExternalStorage

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@stale

stale Bot commented Jul 5, 2026

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the wontfix This will not be worked on label Jul 5, 2026
@stale stale Bot closed this Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant