Using this package we can easily can find any files or directory in a Directory.
Features
- Blur Detection: Evaluates the clarity of the selected image and provides feedback on whether the image is clear or blurry.
Platforms Supported
- Android
Usage
- Blur Detection: Evaluates the clarity of the selected image and provides feedback on whether the image is clear or blurry.
Give the permissions
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA"/>
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:blur_detector/blur_detector.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Blur Detector Example',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const BlurDetectorScreen(),
);
}
}
class BlurDetectorScreen extends StatefulWidget {
const BlurDetectorScreen({Key? key}) : super(key: key);
@override
_BlurDetectorScreenState createState() => _BlurDetectorScreenState();
}
class _BlurDetectorScreenState extends State<BlurDetectorScreen> {
final ImagePicker _picker = ImagePicker();
File? _image;
String _result = '';
Future<void> _pickImage() async {
final XFile? image = await _picker.pickImage(source: ImageSource.gallery);
if (image != null) {
setState(() {
_image = File(image.path);
_result = '';
});
final bool isImageClear = await BlurRadio.evaluateImageQuality(
image: File(image.path),
acceptableBlurThreshold: 50,
);
setState(() {
_result = isImageClear
? "The image is clear and readable."
: "The image is blurry or text is not readable.";
});
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Blur Detector Example'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
if (_image != null) Image.file(_image!),
const SizedBox(height: 20),
ElevatedButton(
onPressed: _pickImage,
child: const Text('Pick an Image'),
),
const SizedBox(height: 20),
Text(
_result,
style: const TextStyle(fontSize: 18),
),
],
),
),
);
}
}
Contributors
- Blur Detection: Evaluates the clarity of the selected image and provides feedback on whether the image is clear or blurry.
Having Issues
- Blur Detection: Evaluates the clarity of the selected image and provides feedback on whether the image is clear or blurry.
Looking to contribute to this package:
🤘🏻 Great!
- Blur Detection: Evaluates the clarity of the selected image and provides feedback on whether the image is clear or blurry.