myid_config.dart 2.36 KB
Newer Older
Javohir Savriy's avatar
Javohir Savriy committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import 'enums.dart';

part 'myid_config.g.dart';

class MyIdConfig {
  final String clientId;
  final String? passportData;
  final String? dateOfBirth;
  final String? sdkHash;
  final String? externalId;
  final double? threshold;
  final MyIdBuildMode? buildMode;
  final MyIdEntryType? entryType;
  final MyIdResidentType? residency;
  final MyIdLocale? locale;
  final MyIdCameraShape? cameraShape;
  final MyIdResolution? resolution;
  final MyIdImageFormat? imageFormat;
  final MyIdOrganizationDetails? organizationDetails;
  final bool? withPhoto;

  MyIdConfig({
    required this.clientId,
    this.passportData,
    this.dateOfBirth,
    this.sdkHash,
    this.externalId,
    this.threshold,
    this.buildMode,
    this.entryType,
    this.residency,
    this.locale,
    this.cameraShape,
    this.resolution,
    this.imageFormat,
    this.organizationDetails,
    this.withPhoto,
  });

  factory MyIdConfig.fromJson(Map<String, dynamic> json) =>
      _$MyIdConfigFromJson(json);

  Map<String, dynamic> toJson() => _$MyIdConfigToJson(this);
}

class MyIdResult {
  final String? code;
Javokhir's avatar
Javokhir committed
48
  final String? comparison;
Javohir Savriy's avatar
Javohir Savriy committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
  final String? base64;

  MyIdResult({
    this.code,
    this.comparison,
    this.base64
  });

  factory MyIdResult.fromJson(Map<String, dynamic> json) =>
      _$MyIdResultFromJson(json);
}

class MyIdOrganizationDetails {
  final String? phone;

  const MyIdOrganizationDetails({
    required this.phone
  });

  factory MyIdOrganizationDetails.fromJson(Map<String, dynamic> json) =>
      _$MyIdOrganizationDetailsFromJson(json);

  Map<String, dynamic> toJson() => _$MyIdOrganizationDetailsToJson(this);
}

class MyIdIOSAppearance {
  final String? primaryColor;
  final String? secondaryColor;
  final String? errorColor;
  final String? primaryButtonColor;
  final String? primaryButtonColorDisabled;
  final String? primaryButtonTextColor;
  final String? primaryButtonTextColorDisabled;
  final int? buttonCornerRadius;

  const MyIdIOSAppearance({
    this.primaryColor,
    this.secondaryColor,
    this.errorColor,
    this.primaryButtonColor,
    this.primaryButtonColorDisabled,
    this.primaryButtonTextColor,
    this.primaryButtonTextColorDisabled,
    this.buttonCornerRadius,
  });

  factory MyIdIOSAppearance.fromJson(Map<String, dynamic> json) =>
      _$MyIdIOSAppearanceFromJson(json);

  Map<String, dynamic> toJson() => _$MyIdIOSAppearanceToJson(this);
}