Skip to main content

socrits_effects 0.1.1 copy "socrits_effects: ^0.1.1" to clipboard
socrits_effects: ^0.1.1 copied to clipboard

On-device face detection & camera effects for Socrits — face detection, landmarks, expressions, and a live overlay widget.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:socrits_effects/socrits_effects.dart';

void main() => runApp(const MaterialApp(home: FaceDemo()));

class FaceDemo extends StatefulWidget {
  const FaceDemo({super.key});

  @override
  State<FaceDemo> createState() => _FaceDemoState();
}

class _FaceDemoState extends State<FaceDemo> {
  int _count = 0;
  bool _smiling = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Socrits face detection')),
      body: Stack(
        children: [
          SocritsFaceCam(
            showLandmarks: true,
            onFaces: (faces) => setState(() {
              _count = faces.length;
              _smiling = faces.isNotEmpty && faces.first.isSmiling;
            }),
          ),
          Positioned(
            left: 16,
            bottom: 24,
            child: Container(
              padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
              decoration: BoxDecoration(
                color: Colors.black54,
                borderRadius: BorderRadius.circular(10),
              ),
              child: Text(
                '$_count face(s)${_smiling ? ' · smiling' : ''}',
                style: const TextStyle(color: Colors.white),
              ),
            ),
          ),
        ],
      ),
    );
  }
}
1
likes
150
points
435
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

On-device face detection & camera effects for Socrits — face detection, landmarks, expressions, and a live overlay widget.

Homepage

Topics

#face-detection #camera #ml #effects #socrits

License

MIT (license)

Dependencies

camera, flutter, google_mlkit_commons, google_mlkit_face_detection

More

Packages that depend on socrits_effects