simple_native 0.1.2
simple_native: ^0.1.2 copied to clipboard
A comprehensive Flutter plugin for accessing native device features including Camera (Photos, QR & Barcode), Location, Device Information, and Biometric Authentication.
0.1.2 #
- AI Standalone Execution (
SimpleAI):- Tách luồng chạy AI ra độc lập (Standalone inference API), cho phép sử dụng
loadModel,runModelOnImage, vàrunModelOnBytesđể nhận diện đối tượng hoặc góc ảnh mà không cần khởi tạo camera.
- Tách luồng chạy AI ra độc lập (Standalone inference API), cho phép sử dụng
- Fix Duplicate Symbols (iOS):
- Di chuyển Liveness Detection (nhận diện nháy mắt, mỉm cười, quay đầu) trên iOS từ Google MediaPipe sang Google ML Kit Face Detection để giải quyết triệt để lỗi xung đột thư viện
duplicate symbols(TFLiteC & GTMSessionFetcher). - Giảm dung lượng build iOS do loại bỏ thư viện MediaPipe.
- Đảm bảo tính nhất quán thuật toán Liveness giữa hai nền tảng Android và iOS.
- Di chuyển Liveness Detection (nhận diện nháy mắt, mỉm cười, quay đầu) trên iOS từ Google MediaPipe sang Google ML Kit Face Detection để giải quyết triệt để lỗi xung đột thư viện
0.1.1 #
- TFLite & Object Detection:
- Added support for YOLOv8 TFLite model output format (e.g.
[1, 12, 8400]). - Added
processIntervalMsparameter toSimpleCameraViewto throttle AI frame processing frequency, reducing CPU load. - Improved object cropping with expanded bounding box margins (8% horizontal, 5% vertical) to ensure full object visibility.
- Added support for YOLOv8 TFLite model output format (e.g.
0.1.0 #
- AI Liveness (Android & iOS):
- Implemented AI Liveness using Google MediaPipe Tasks Vision.
- Added
LivenessThresholdConfigfor detailed configuration in FlutterSimpleCameraView. - Split head rotation thresholds into independent directional configs (
yawThresholdandpitchThresholdfor horizontal/vertical). - Improved head up/down detection logic.
0.0.22 #
- TFLite & Object Detection (Android & iOS):
- Added TFLite & Google ML Kit Object Detection support with custom TFLite model integration (
customModelPath). - Added
objectDetectioncamera mode toSimpleCameraTypeandMlKitObjectCategoryfiltering enum. - Added
loadModel,startModelInference,stopModelInference,pauseScanning, andonModelResulttoSimpleCameraController. - Optimized Android camera frame pipeline with YUV420 to NV21 byte buffer reuse and FPS throttling for memory efficiency.
- Ensured strict camera lifecycle thread safety on Android (
openCameraon main looper).
- Added TFLite & Google ML Kit Object Detection support with custom TFLite model integration (
0.0.20 #
- Camera (QR & Barcode Scanning) - Android:
- Fixed camera failure to open (infinite loading spinner) when repeatedly opening/closing the scanning screen by implementing a global camera instance manager and queue (
activeInstanceandpendingOpenRequests). - Fixed silent asynchronous errors by notifying the Flutter UI via MethodChannel in
StateCallback.onError(). - Resolved potential NullPointerExceptions in
updatePreview(),createCameraPreview(), andsetupImageReader()by adding strict null checks forcameraCaptureSessionsandimageDimension.
- Fixed camera failure to open (infinite loading spinner) when repeatedly opening/closing the scanning screen by implementing a global camera instance manager and queue (
0.0.19 #
- Camera (QR & Barcode Scanning) - Android & iOS:
- Android: Integrated
ActivityLifecycleCallbacksto automatically pause and resume the camera in sync with the Activity state, preventing resource leaks. - Android: Implemented safe camera switching by waiting for the previous camera's
onClosedcallback before opening the new camera, eliminatingCAMERA_IN_USEerrors. - Android: Highly optimized screenshot capturing (
getBitmap) by moving it to the main thread and triggering it only when a barcode/QR code is successfully detected, saving significant CPU/RAM cycles. - Android: Optimized image stream data copying to avoid JNI pixel-by-pixel reads, improving frame pipeline performance.
- iOS: Prevented main thread UI freezing during camera disposal by running
stopRunning()asynchronously in a background thread. - iOS: Resolved potential hanging on iOS Simulator during
takePicturecalls by immediately returning aFlutterErrorwhen the camera output is unavailable. - Android & iOS: Marked camera resources
volatileand added safety guards and null checks to prevent multithreading race conditions.
- Android: Integrated
0.0.18 #
- Camera (QR & Barcode Scanning):
- Fixed camera device state, closing, and opening sequence order on Android to prevent potential crashes and resource leaks during state transitions.
0.0.17 #
- Camera (QR & Barcode Scanning):
- Added
scanWindowparameter toSimpleCameraViewto restrict barcode/QR code scanning to a specific rectangular region of interest (ROI) on both Android and iOS. - Added
setScanWindowmethod toSimpleCameraControllerto dynamically update the scan window at runtime. - Integrated layout builder in the example app to demonstrate scanning constraint within a yellow bordered box.
- Added
0.0.16 #
- Camera (QR & Barcode Scanning):
- Added support for simultaneous multi-code detection on both Android and iOS, returning a list of bounding box coordinates mapped to logical screen dimensions.
- Added support for
freezeOnResultparameter to pause/freeze camera preview upon detection. - Resolved frame-pipeline latency and coordinate shift issues on freeze-frame by capturing native snapshots (via
.getBitmap()on Android and preview layer contexts on iOS) and rendering them as static overlays in Flutter. - Optimized Android camera preview scanning thread model (ImageReader background worker) to prevent lag.
- Added native focus checks (Android's
CONTROL_AF_STATEand iOS'sisAdjustingFocus) to ensure the camera only freezes on sharp, clear frames. - Fixed iOS metadata delegate timeout bug to ensure same-QR codes are scanned correctly when pointing away and back.
0.0.15 #
- Camera:
- Synchronized camera loading behavior on iOS with Android by implementing the
onCameraReadyevent. - The iOS camera view now correctly detects when the first frame is rendered to dismiss the
loadingWidgetseamlessly, ensuring a smooth UX without UI flickering.
- Synchronized camera loading behavior on iOS with Android by implementing the
0.0.14 #
- Plugin Info:
- Updated package description in
pubspec.yamlto explicitly mention support for Barcode scanning and Biometric Authentication.
- Updated package description in
- Camera:
- Upgraded QR code scanning to support general barcode scanning on both Android and iOS simultaneously. The
SimpleCameraResultTypenow includes abarcodetype to distinguish between QR codes and regular barcodes.
- Upgraded QR code scanning to support general barcode scanning on both Android and iOS simultaneously. The
0.0.13 #
- Android:
- Upgraded
com.google.mlkit:barcode-scanningto version18.3.0to support Android 16 KB page sizes. - Fixed an issue where Face ID (weak biometric) might not prompt on certain Android devices by correctly setting
AllowedAuthenticators.
- Upgraded
0.0.12 #
- Biometrics:
- Breaking Change: Refactored
getAvailableBiometricto returnSimpleBiometricTypedirectly instead of a String, and removednotEnrolled. It now focuses purely on hardware capabilities (face,fingerprint,iris,notSupported). - Added support for
irisbiometric type on Android. - Breaking Change: Refactored
authenticatestates.notEnrolledis merged intonotSupported. The method can now be safely called multiple times sequentially without getting stuck on both Android and iOS. - Fixed a bug on Android where
authenticaterequiredFragmentActivityon all versions. It now supports the defaultFlutterActivity. - Added a new method
openBiometricSettings()to deep-link users directly to the system's biometric enrollment/security settings page on both Android and iOS.
- Breaking Change: Refactored
- Documentation:
- Updated
README.mdto reflect the new biometric flow andopenBiometricSettingsusage.
- Updated
0.0.11 #
- Camera:
- Fixed
takePicturereturning null on iOS by properly handling async result callback. - Improved iOS camera stability: added
isSwitchingandisDisposedflags to prevent race conditions and crashes during rapid interactions. - Implemented explicit
stopCameramethod on iOS for better resource cleanup. - Ensured
takePicturereturns a valid file path on both Android and iOS.
- Fixed
0.0.10 #
- SimpleDeviceInfo:
- Core: Added deviceId to SimpleDeviceInfo.
- Native: Implemented persistent ID across reinstalls via ANDROID_ID (Android) and Keychain (iOS).
0.0.9 #
- Location:
- Fixed location address retrieval.
0.0.8 #
- Camera:
- Added
cameraPositionparameter toSimpleCameraViewto allow selecting the initial camera (front/back). - Fixed
IllegalStateException: CameraDevice was already closedcrash on Android when switching cameras rapidly. - Fixed
updateAcquireFence: Did not find frameerror on Android by properly managing Surface lifecycle. - Improved camera resource management and cleanup on both Android and iOS.
- Added support for mirroring front camera preview on iOS.
- Added
0.0.7 #
- Metadata:
- Added
topicstopubspec.yamlto improve package discoverability on pub.dev. - Keywords include:
camera,location,device-info,native,plugin.
- Added
0.0.5 #
- Refactor:
- Merged
SimpleCameraConverterfunctionality intoSimpleCameraImage. - Added
toImage()method toSimpleCameraImagefor easy conversion to BMP format. - Removed
SimpleCameraConverterclass.
- Merged
- Documentation:
- Updated README to reflect the API changes and new version.
- Updated package description in
pubspec.yamlto be more professional.
0.0.4 #
- Camera:
- Made
onResultcallback optional inSimpleCameraView. - Fixed camera preview orientation issues on iOS.
- Locked camera view to portrait orientation on both Android and iOS to prevent unwanted rotation.
- Fixed image stream rotation on iOS (now correctly oriented).
- Added support for mirroring front camera stream on iOS.
- Made
- Documentation:
- Updated README with new features and license information.
- Added BSD 3-Clause License.
0.0.1 #
- Initial release.
- Added
SimpleCameraViewfor camera preview and image capture. - Added
SimpleNativeclass for accessing native features. - Implemented
getCurrentLocationto retrieve device coordinates. - Implemented
getDeviceInfoto retrieve device details. - Supported Android and iOS platforms.