face_scanning_id 0.0.2+3 copy "face_scanning_id: ^0.0.2+3" to clipboard
face_scanning_id: ^0.0.2+3 copied to clipboard

A Flutter package providing customizable face scanning UI widgets with camera integration and visual feedback.

Face Scanning ID #

pub package CI codecov License: MIT

A Flutter package providing customizable face scanning UI widgets with camera integration and visual feedback. Perfect for identity verification, biometric authentication, and face detection features.

Developed and maintained by UM Software

Features #

Customizable UI Components

  • Circular face scanning overlay with animated ring
  • Progress indicator for scanning feedback
  • Fully customizable colors, sizes, and styling

📷 Camera Integration

  • Built on top of Flutter's camera plugin
  • Support for front/back camera
  • Mirror preview option
  • Real-time camera preview

🎨 Visual Feedback

  • Animated scanning ring
  • Progress tracking
  • Status messages
  • Placeholder icons

Getting started #

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  face_scanning_id: ^0.0.1

Then run:

flutter pub get

Prerequisites #

  • Flutter SDK >=1.17.0
  • Dart SDK ^3.10.4
  • Camera permissions configured in your app:
    • iOS: Add camera usage description to Info.plist
    • Android: Add camera permission to AndroidManifest.xml

Usage #

Basic Example #

import 'package:face_scanning_id/face_scanning_id.dart';
import 'package:camera/camera.dart';

class FaceScanScreen extends StatefulWidget {
  @override
  _FaceScanScreenState createState() => _FaceScanScreenState();
}

class _FaceScanScreenState extends State<FaceScanScreen> {
  CameraController? _cameraController;
  bool _isScanning = false;
  double _progress = 0.0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: ScanFaceWidget(
        diameter: 300,
        ringSize: 20,
        cameraController: _cameraController,
        isScanning: _isScanning,
        cameraInitialized: _cameraController?.value.isInitialized ?? false,
        progress: _progress,
        message: 'Position your face in the circle',
        onStartScanning: () {
          setState(() => _isScanning = true);
        },
        onUpdateOverlay: (circleRect, previewSize) {
          // Handle overlay updates
        },
      ),
    );
  }
}

Customization #

ScanFaceWidget(
  diameter: 300,
  ringSize: 20,
  borderColor: Colors.blue,
  progressColor: Colors.green,
  backgroundColor: Colors.black,
  textColor: Colors.white,
  buttonColor: Colors.blue,
  strokeWidth: 8.0,
  // ... other parameters
)

Orientation Support #

The package automatically handles device orientation changes (portrait and landscape). The camera preview dynamically adjusts to maintain proper aspect ratio without distortion across all screen orientations.

Features:

  • ✅ Automatic aspect ratio adjustment for portrait and landscape modes
  • ✅ No distortion or flattening of camera preview during rotation
  • ✅ Camera view properly fills the circular overlay in all orientations
  • ✅ Smooth transition between orientation changes

To enable orientation support in your app:

import 'package:flutter/services.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  
  // Allow all orientations
  SystemChrome.setPreferredOrientations([
    DeviceOrientation.portraitUp,
    DeviceOrientation.portraitDown,
    DeviceOrientation.landscapeLeft,
    DeviceOrientation.landscapeRight,
  ]);
  
  runApp(MyApp());
}

Note: The camera preview automatically adapts when the device rotates. No additional configuration is required.

API Reference #

ScanFaceWidget Parameters #

Parameter Type Description
diameter double Diameter of the scanning circle
ringSize double Size of the ring around the circle
cameraController CameraController? Camera controller instance
isScanning bool Whether scanning is active
progress double Scanning progress (0.0 - 1.0)
message String Status message to display
borderColor Color Color of the circle border
progressColor Color Color of the progress indicator
onStartScanning VoidCallback? Callback when scanning starts
onUpdateOverlay Function? Callback for overlay updates

Additional information #

Support #

  • Issues: Report bugs or request features on GitHub Issues
  • Contributing: Contributions are welcome! Please read our contributing guidelines.
  • License: MIT License

About UM Software #

This package is developed and maintained by UM Software. We specialize in creating high-quality Flutter packages and applications.

Changelog #

See CHANGELOG.md for version history and updates.

2
likes
0
points
127
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package providing customizable face scanning UI widgets with camera integration and visual feedback.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

camera, flutter, get, google_mlkit_commons

More

Packages that depend on face_scanning_id