toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return removeNulls({
    'genuine_presence_assurance': genuinePresenceAssurance.toJson(),
    'liveness_assurance': livenessAssurance.toJson(),
    'filter': filter?.stringValue,
    'line_color': lineColor?.hex,
    'background_color': backgroundColor?.hex,
    'header_background_color': headerBackgroundColor?.hex,
    'footer_background_color': footerBackgroundColor?.hex,
    'header_text_color': headerTextColor?.hex,
    'prompt_text_color': promptTextColor?.hex,
    'floating_prompt_enabled': floatingPromptEnabled,
    'title': title,
    'font_path': fontPath,
    'enable_screenshots': enableScreenshots,
    'orientation': orientation?.stringValue,
    'activity_compatibility_request_code': activityCompatibilityRequestCode,
    'close_button_tint_color': closeButtonTintColor?.hex,
    if (logoImage != null) 'logo_image': base64.encode(encodePng(logoImage!)),
    if (closeButtonImage != null)
      'close_button_image': base64.encode(encodePng(closeButtonImage!)),
  });
}