configure method
Future<bool?>
configure({
- required String key,
- String? customerCode,
- SmKitPoseModelChoice poseModelChoice = SmKitPoseModelChoice.adaptiveChoice,
- SMKitLanguage configureLanguage = SMKitLanguage.english,
- bool includesHighlights = false,
- bool includesObjectDetectionFeedbacks = false,
- SMKitModelDownloadPolicy modelDownloadPolicy = SMKitModelDownloadPolicy.waitForRemoteModelsThenFallback,
- void onHandle()?,
override
Implementation
@override
Future<bool?> configure({
required String key,
String? customerCode,
SmKitPoseModelChoice poseModelChoice = SmKitPoseModelChoice.adaptiveChoice,
SMKitLanguage configureLanguage = SMKitLanguage.english,
bool includesHighlights = false,
bool includesObjectDetectionFeedbacks = false,
SMKitModelDownloadPolicy modelDownloadPolicy =
SMKitModelDownloadPolicy.waitForRemoteModelsThenFallback,
void Function(SMKitStatus)? onHandle,
}) async {
final arg = {
'apiPublicKey': key,
if (customerCode != null) 'customerCode': customerCode,
'poseModelChoice': poseModelChoice.nativeValue,
'configureLanguage': configureLanguage.name,
'includesHighlights': includesHighlights,
if (includesObjectDetectionFeedbacks)
'includesObjectDetectionFeedbacks': true,
if (modelDownloadPolicy !=
SMKitModelDownloadPolicy.waitForRemoteModelsThenFallback)
'modelDownloadPolicy': modelDownloadPolicy.name,
};
bool? res = false;
try {
return await methodChannel.invokeMethod<bool?>('configure', arg);
} on PlatformException catch (e) {
debugPrint('PlatformException: ${e.code} ${e.message}');
}
return res;
}