enrollFinishWithoutPushingActivity method
Completes the enrollment process without pushing the activity to the server.
This method registers callbacks for various stages of the enrollment process
and invokes the enrollFinishActivity
method on the platform's method channel.
Parameters:
withGlasses
(required): A boolean indicating whether the user is wearing glasses.onPercentageChanged
(optional): A callback function that is triggered when the enrollment percentage changes.onCompleted
(optional): A callback function that is triggered when the enrollment process is completed. The function receives aMap<String, dynamic>
containing the completion arguments.onFailed
(optional): A callback function that is triggered when the enrollment process fails.
Implementation
Future<void> enrollFinishWithoutPushingActivity({
required bool withGlasses,
Function(dynamic)? onPercentageChanged,
Function(Map<String, dynamic>)? onCompleted,
Function(dynamic)? onFailed,
}) async {
registerCallback("onPercentageChanged", onPercentageChanged ?? (_) {});
registerCallback("onCompleted", (arguments) {
if (onCompleted != null) {
final Map<String, dynamic> args = jsonDecode(arguments);
onCompleted(args);
}
});
registerCallback("onFailed", onFailed ?? (_) {});
await methodChannel.invokeMethod('enrollFinishActivity', {
'withGlasses': withGlasses,
'withoutServerPushing': true,
});
}