toMap method

Map<String, dynamic> toMap()

Convert options to a map for platform channel

Implementation

Map<String, dynamic> toMap() {
  final map = <String, dynamic>{
    'flow': 'enrollment',
    'cameraPosition':
        cameraPosition == SmartfaceCameraPosition.front ? 'front' : 'back',
    'withoutServerPushing': withoutServerPushing,
    'saveImage': saveImage,
  };

  // Only include optional parameters if provided
  if (customId != null) map['customId'] = customId;
  if (groupA != null) map['groupA'] = groupA;
  if (groupB != null) map['groupB'] = groupB;
  if (withGlasses != null) map['withGlasses'] = withGlasses;

  return map;
}