【FLUTTER ANDROID STUDIO and IOS】Snapshot like AR face filter

 import 'package:flutter/material.dart';

import 'package:camera_deep_ar/camera_deep_ar.dart';


void main() {
runApp(MyApp());
}

const apiKey =
'357e97a8f4885d89efedbde9342e62a15f6cfe36e49fd27c2edbfde530d92af48853c542c324e230';

class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
CameraDeepArController cameraDeepArController;
int count = 0;

@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: Scaffold(
body: Stack(
children: <Widget>[
CameraDeepAr(
onCameraReady: (isReady) {
setState(() {});
},
onImageCaptured: (path) {
setState(() {});
},
onVideoRecorded: (path) {
setState(() {});
},
androidLicenceKey: apiKey,
iosLicenceKey: apiKey,
cameraDeepArCallback: (c) async {
cameraDeepArController = c;
setState(() {});
}),
Align(
alignment: Alignment.bottomRight,
child: Container(
padding: EdgeInsets.all(20),
child: FloatingActionButton(
child: Icon(Icons.navigate_next_outlined),
onPressed: () {
cameraDeepArController.changeMask(count);
count == 7 ? count = 0 : count++;
}),
),
),
],
),
),
);
}
}

No comments:

Renowned Water Expert Reynold Aquino Offers Exclusive Water Softener Discounts

Los Angeles, California - November 21, 2024 - World-renowned water expert Reynold Aquino is excited to announce exclusive discounts on prem...

Contact Form

Name

Email *

Message *