Manual Selfie
Get the selfie module from the main AmaniSDK
instance which you have previously initialized.
// Since the platform plugins are async, you must create this function
Future<void> initSelfie() async {
var selfie = AmaniSDK().getSelfie();
await selfie.setType("XXX_SE_0");
}
//And call it here.
void initState() {
super.initState();
initSelfie();
}
Later on the buttons onPressed
onPressed: () async {
final Uint8List imageData =
await AmaniSDK().getSelfie().start();
// Do something with imageData
setState(() {
_imageData = imageData;
});
},
After getting the image data from the SDK, you can use it with Image.memory()
.