← Code knowledge base
Reviewed Flutter implementation · 2026-10-27

sumsub_kyc_adapter.dart

mobile_flutter/lib/features/kyc/data/sumsub_kyc_adapter.dart

Immutable source snapshot based on revision de78e63ed65c. Original line numbers are retained. This is implementation evidence; check the public API catalogue before adapting it.

The mobile /api/v1/mobile routes belong to the example backend. Company credentials stay on that backend. Some sections outside the documented product scope may be omitted.

Lines 1–72

import 'dart:ui'; import 'package:flutter/foundation.dart';import 'package:flutter_idensic_mobile_sdk_plugin/flutter_idensic_mobile_sdk_plugin.dart'; class SumsubVerificationResult {  const SumsubVerificationResult({    required this.success,    required this.status,    this.errorType,    this.errorMessage,  });   final bool success;  final String status;  final String? errorType;  final String? errorMessage;} class SumsubKycAdapter {  const SumsubKycAdapter({this.locale = const Locale('en')});   final Locale locale;   Future<SumsubVerificationResult> startVerification({    required String accessToken,    required Future<String> Function() onTokenExpiration,  }) async {    if (accessToken.isEmpty) {      throw ArgumentError.value(        accessToken,        'accessToken',        'Must not be empty',      );    }     final sdk = SNSMobileSDK.init(accessToken, onTokenExpiration)        .withLocale(locale)        .withDebug(kDebugMode)        .withHandlers(      onStatusChanged: (newStatus, oldStatus) {        debugPrint('SumSub status changed: $oldStatus -> $newStatus');      },      onEvent: (event) {        debugPrint('SumSub event: $event');      },    ).withLogHandler((level, message) {      debugPrint('SumSub [$level] $message');    }).build();     final result = await sdk.launch();    final verificationResult = SumsubVerificationResult(      success: result.success,      status: result.status.name,      errorType: result.errorType?.name,      errorMessage: result.errorMsg,    );     if (!result.success) {      final details = [        'status=${verificationResult.status}',        if (verificationResult.errorType != null)          'error=${verificationResult.errorType}',        if (verificationResult.errorMessage != null)          verificationResult.errorMessage,      ].join(', ');      throw StateError('SumSub SDK did not complete successfully: $details');    }     return verificationResult;  }}
HOPPA DEVELOPER ASSISTANT

What are you building?

From a question to an implementation.

Get a step-by-step flow, example code and the docs behind it. Choose a starting point or describe your feature.

Answers use the public API guide and example app code. Check the linked reference before shipping. Explore code sources ↗

Your question and recent conversation are sent to our AI provider. Don’t include API keys, personal data or card details.