• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vaariance / web3-signers / #2

12 Jan 2026 04:17PM UTC coverage: 36.402%. First build
#2

push

code-z2
refactor: fix typo in isPermanent field and improve documentation

- Correct spelling of isPermanent in DarwinOptions across multiple files
- Add comprehensive documentation for signer classes and methods
- Improve code formatting and consistency in platform-specific implementations
- Update README with detailed usage instructions and migration guide

4 of 85 new or added lines in 5 files covered. (4.71%)

427 of 1173 relevant lines covered (36.4%)

1.15 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

1.68
/lib/src/api/android_auth.g.dart
1
// Autogenerated from Pigeon (v26.1.5), do not edit directly.
2
// See also: https://pub.dev/packages/pigeon
3
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, omit_obvious_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers
4

5
import 'dart:async';
6
import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List;
7

8
import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer;
9
import 'package:flutter/services.dart';
10

11
PlatformException _createConnectionError(String channelName) {
×
12
  return PlatformException(
×
13
    code: 'channel-error',
14
    message: 'Unable to establish connection on channel: "$channelName".',
×
15
  );
16
}
17

18
bool _deepEquals(Object? a, Object? b) {
×
19
  if (a is List && b is List) {
×
20
    return a.length == b.length &&
×
NEW
21
        a.indexed.every(
×
NEW
22
          ((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]),
×
23
        );
24
  }
25
  if (a is Map && b is Map) {
×
NEW
26
    return a.length == b.length &&
×
NEW
27
        a.entries.every(
×
NEW
28
          (MapEntry<Object?, Object?> entry) =>
×
NEW
29
              (b as Map<Object?, Object?>).containsKey(entry.key) &&
×
NEW
30
              _deepEquals(entry.value, b[entry.key]),
×
31
        );
32
  }
33
  return a == b;
×
34
}
35

36
class AndroidOptions {
37
  AndroidOptions({
2✔
38
    required this.useStrongBoxKeyMint,
39
    required this.authTimeoutSeconds,
40
    required this.requireUserAuthentication,
41
    required this.invalidateOnBiometricChange,
42
    required this.allowFallbackAuthentication,
43
    required this.userConfirmationRequired,
44
    this.attestationChallenge,
45
    required this.biometricPromptTitle,
46
    required this.biometricPromptSubtitle,
47
    required this.biometricPromptDescription,
48
    required this.biometricPromptNegativeButtonText,
49
  });
50

51
  bool useStrongBoxKeyMint;
52

53
  int authTimeoutSeconds;
54

55
  bool requireUserAuthentication;
56

57
  bool invalidateOnBiometricChange;
58

59
  bool allowFallbackAuthentication;
60

61
  bool userConfirmationRequired;
62

63
  Uint8List? attestationChallenge;
64

65
  String biometricPromptTitle;
66

67
  String biometricPromptSubtitle;
68

69
  String biometricPromptDescription;
70

71
  String biometricPromptNegativeButtonText;
72

73
  List<Object?> _toList() {
×
74
    return <Object?>[
×
75
      useStrongBoxKeyMint,
×
76
      authTimeoutSeconds,
×
77
      requireUserAuthentication,
×
78
      invalidateOnBiometricChange,
×
79
      allowFallbackAuthentication,
×
80
      userConfirmationRequired,
×
81
      attestationChallenge,
×
82
      biometricPromptTitle,
×
83
      biometricPromptSubtitle,
×
84
      biometricPromptDescription,
×
85
      biometricPromptNegativeButtonText,
×
86
    ];
87
  }
88

89
  Object encode() {
×
NEW
90
    return _toList();
×
91
  }
92

93
  static AndroidOptions decode(Object result) {
×
94
    result as List<Object?>;
95
    return AndroidOptions(
×
96
      useStrongBoxKeyMint: result[0]! as bool,
×
97
      authTimeoutSeconds: result[1]! as int,
×
98
      requireUserAuthentication: result[2]! as bool,
×
99
      invalidateOnBiometricChange: result[3]! as bool,
×
100
      allowFallbackAuthentication: result[4]! as bool,
×
101
      userConfirmationRequired: result[5]! as bool,
×
102
      attestationChallenge: result[6] as Uint8List?,
×
103
      biometricPromptTitle: result[7]! as String,
×
104
      biometricPromptSubtitle: result[8]! as String,
×
105
      biometricPromptDescription: result[9]! as String,
×
106
      biometricPromptNegativeButtonText: result[10]! as String,
×
107
    );
108
  }
109

110
  @override
×
111
  // ignore: avoid_equals_and_hash_code_on_mutable_classes
112
  bool operator ==(Object other) {
113
    if (other is! AndroidOptions || other.runtimeType != runtimeType) {
×
114
      return false;
115
    }
116
    if (identical(this, other)) {
117
      return true;
118
    }
119
    return _deepEquals(encode(), other.encode());
×
120
  }
121

122
  @override
×
123
  // ignore: avoid_equals_and_hash_code_on_mutable_classes
NEW
124
  int get hashCode => Object.hashAll(_toList());
×
125
}
126

127
class _PigeonCodec extends StandardMessageCodec {
128
  const _PigeonCodec();
6✔
129
  @override
×
130
  void writeValue(WriteBuffer buffer, Object? value) {
131
    if (value is int) {
×
132
      buffer.putUint8(4);
×
133
      buffer.putInt64(value);
×
NEW
134
    } else if (value is AndroidOptions) {
×
135
      buffer.putUint8(129);
×
136
      writeValue(buffer, value.encode());
×
137
    } else {
138
      super.writeValue(buffer, value);
×
139
    }
140
  }
141

142
  @override
×
143
  Object? readValueOfType(int type, ReadBuffer buffer) {
144
    switch (type) {
NEW
145
      case 129:
×
146
        return AndroidOptions.decode(readValue(buffer)!);
×
147
      default:
148
        return super.readValueOfType(type, buffer);
×
149
    }
150
  }
151
}
152

153
class PlatformAuthenticator {
154
  /// Constructor for [PlatformAuthenticator].  The [binaryMessenger] named argument is
155
  /// available for dependency injection.  If it is left null, the default
156
  /// BinaryMessenger will be used which routes to the host platform.
NEW
157
  PlatformAuthenticator({
×
158
    BinaryMessenger? binaryMessenger,
159
    String messageChannelSuffix = '',
160
  }) : pigeonVar_binaryMessenger = binaryMessenger,
161
       pigeonVar_messageChannelSuffix =
NEW
162
           messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
×
163
  final BinaryMessenger? pigeonVar_binaryMessenger;
164

165
  static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
166

167
  final String pigeonVar_messageChannelSuffix;
168

169
  /// Generates a new key pair in the secure element/keystore.
170
  /// Returns the public key as a 65-byte uncompressed byte array (0x04 || X || Y).
171
  /// Throws if generation fails.
172
  Future<Uint8List> createKey(String keyTag, AndroidOptions options) async {
×
173
    final pigeonVar_channelName =
NEW
174
        'dev.flutter.pigeon.web3_signers.PlatformAuthenticator.createKey$pigeonVar_messageChannelSuffix';
×
175
    final pigeonVar_channel = BasicMessageChannel<Object?>(
×
176
      pigeonVar_channelName,
177
      pigeonChannelCodec,
178
      binaryMessenger: pigeonVar_binaryMessenger,
×
179
    );
NEW
180
    final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
×
NEW
181
      <Object?>[keyTag, options],
×
182
    );
183
    final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
184
    if (pigeonVar_replyList == null) {
185
      throw _createConnectionError(pigeonVar_channelName);
×
186
    } else if (pigeonVar_replyList.length > 1) {
×
187
      throw PlatformException(
×
188
        code: pigeonVar_replyList[0]! as String,
×
189
        message: pigeonVar_replyList[1] as String?,
×
190
        details: pigeonVar_replyList[2],
×
191
      );
192
    } else if (pigeonVar_replyList[0] == null) {
×
193
      throw PlatformException(
×
194
        code: 'null-error',
195
        message: 'Host platform returned null value for non-null return value.',
196
      );
197
    } else {
198
      return (pigeonVar_replyList[0] as Uint8List?)!;
×
199
    }
200
  }
201

202
  /// Deletes the key associated with the given tag.
203
  Future<void> deleteKey(String keyTag) async {
×
204
    final pigeonVar_channelName =
NEW
205
        'dev.flutter.pigeon.web3_signers.PlatformAuthenticator.deleteKey$pigeonVar_messageChannelSuffix';
×
206
    final pigeonVar_channel = BasicMessageChannel<Object?>(
×
207
      pigeonVar_channelName,
208
      pigeonChannelCodec,
209
      binaryMessenger: pigeonVar_binaryMessenger,
×
210
    );
NEW
211
    final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
×
NEW
212
      <Object?>[keyTag],
×
213
    );
214
    final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
215
    if (pigeonVar_replyList == null) {
216
      throw _createConnectionError(pigeonVar_channelName);
×
217
    } else if (pigeonVar_replyList.length > 1) {
×
218
      throw PlatformException(
×
219
        code: pigeonVar_replyList[0]! as String,
×
220
        message: pigeonVar_replyList[1] as String?,
×
221
        details: pigeonVar_replyList[2],
×
222
      );
223
    } else {
224
      return;
225
    }
226
  }
227

228
  /// Signs the data using the key associated with the given tag.
229
  /// Returns the signature (R || S) bytes.
NEW
230
  Future<Uint8List> sign(
×
231
    String keyTag,
232
    Uint8List data,
233
    AndroidOptions options,
234
  ) async {
235
    final pigeonVar_channelName =
NEW
236
        'dev.flutter.pigeon.web3_signers.PlatformAuthenticator.sign$pigeonVar_messageChannelSuffix';
×
237
    final pigeonVar_channel = BasicMessageChannel<Object?>(
×
238
      pigeonVar_channelName,
239
      pigeonChannelCodec,
240
      binaryMessenger: pigeonVar_binaryMessenger,
×
241
    );
NEW
242
    final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
×
NEW
243
      <Object?>[keyTag, data, options],
×
244
    );
245
    final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
246
    if (pigeonVar_replyList == null) {
247
      throw _createConnectionError(pigeonVar_channelName);
×
248
    } else if (pigeonVar_replyList.length > 1) {
×
249
      throw PlatformException(
×
250
        code: pigeonVar_replyList[0]! as String,
×
251
        message: pigeonVar_replyList[1] as String?,
×
252
        details: pigeonVar_replyList[2],
×
253
      );
254
    } else if (pigeonVar_replyList[0] == null) {
×
255
      throw PlatformException(
×
256
        code: 'null-error',
257
        message: 'Host platform returned null value for non-null return value.',
258
      );
259
    } else {
260
      return (pigeonVar_replyList[0] as Uint8List?)!;
×
261
    }
262
  }
263

264
  /// Retrieves the public key for the given tag.
265
  /// Returns 65-byte uncompressed public key.
266
  Future<Uint8List?> getPublicKey(String keyTag) async {
×
267
    final pigeonVar_channelName =
NEW
268
        'dev.flutter.pigeon.web3_signers.PlatformAuthenticator.getPublicKey$pigeonVar_messageChannelSuffix';
×
269
    final pigeonVar_channel = BasicMessageChannel<Object?>(
×
270
      pigeonVar_channelName,
271
      pigeonChannelCodec,
272
      binaryMessenger: pigeonVar_binaryMessenger,
×
273
    );
NEW
274
    final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
×
NEW
275
      <Object?>[keyTag],
×
276
    );
277
    final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
278
    if (pigeonVar_replyList == null) {
279
      throw _createConnectionError(pigeonVar_channelName);
×
280
    } else if (pigeonVar_replyList.length > 1) {
×
281
      throw PlatformException(
×
282
        code: pigeonVar_replyList[0]! as String,
×
283
        message: pigeonVar_replyList[1] as String?,
×
284
        details: pigeonVar_replyList[2],
×
285
      );
286
    } else {
287
      return (pigeonVar_replyList[0] as Uint8List?);
×
288
    }
289
  }
290
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc