Privacy-friendly NSFW detection for Flutter apps, running fully on-device.
flutter pub add nsfw_detectSnapshot
flutter pub add nsfw_detect
status
version
score
platforms
Privacy-friendly NSFW detection for Flutter apps, running fully on-device.
Use nsfw_detect to scan images, videos, selected media, photo libraries, and camera frames locally with Core ML on iOS and TensorFlow Lite on Android.
Detection is probabilistic. Use it as a local moderation signal and one layer in a broader safety workflow.
Features On-device NSFW detection for Flutter apps Image, video, photo library, native picker, file, bytes, and camera scanning iOS support via Core ML and Vision Android support via TensorFlow Lite Stream-based scan results and progress updates Configurable confidence thresholds and model selection Classification categories: safe, suggestive, nudity, explicit nudity, unknown Optional detection mode with body-part bounding boxes Incremental scan cache for large media libraries Ready-to-use widgets and headless Dart APIs No telemetry or automatic media transmission by the plugin
dependencies:
nsfw_detect: ^2.1.1flutter pub getimport 'package:flutter/foundation.dart';
import 'package:nsfw_detect/nsfw_detect.dart';final status = await NsfwDetector.instance.requestPermission();
if (status != PhotoLibraryPermissionStatus.authorized &&
status != PhotoLibraryPermissionStatus.limited) {
// Show your permission UI or fallback flow.
return;
}final session = await NsfwDetector.instance.startScan(
const ScanConfiguration(
confidenceThreshold: 0.75,
includeVideos: true,
maxVideoFrames: 8,
),
);session.results.listen((result) {
if (result.isNsfw) {
debugPrint(
'${result.item.localIdentifier}: '
'${result.topCategory.displayName} '
'${(result.topConfidence * 100).toStringAsFixed(1)}%',
);
}
});session.progress.listen((progress) {
debugPrint('${progress.scannedCount}/${progress.totalCount}');
});final summary = await session.done;
debugPrint('Scanned ${summary.totalScanned} items.');git clone https://github.com/nexas105/flutter_nsfw_scaner.git
cd flutter_nsfw_scaner/example
flutter pub get
flutter run