• 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.87
/lib/src/api/windows_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 WindowsOptions {
37
  WindowsOptions({
2✔
38
    required this.useTpm,
39
    required this.requireUserAuthentication,
40
    required this.uiPolicyFriendlyName,
41
    required this.uiPolicyDescription,
42
    this.attestationChallenge,
43
  });
44

45
  bool useTpm;
46

47
  bool requireUserAuthentication;
48

49
  String uiPolicyFriendlyName;
50

51
  String uiPolicyDescription;
52

53
  Uint8List? attestationChallenge;
54

55
  List<Object?> _toList() {
×
56
    return <Object?>[
×
57
      useTpm,
×
58
      requireUserAuthentication,
×
59
      uiPolicyFriendlyName,
×
60
      uiPolicyDescription,
×
61
      attestationChallenge,
×
62
    ];
63
  }
64

65
  Object encode() {
×
NEW
66
    return _toList();
×
67
  }
68

69
  static WindowsOptions decode(Object result) {
×
70
    result as List<Object?>;
71
    return WindowsOptions(
×
72
      useTpm: result[0]! as bool,
×
73
      requireUserAuthentication: result[1]! as bool,
×
74
      uiPolicyFriendlyName: result[2]! as String,
×
75
      uiPolicyDescription: result[3]! as String,
×
76
      attestationChallenge: result[4] as Uint8List?,
×
77
    );
78
  }
79

80
  @override
×
81
  // ignore: avoid_equals_and_hash_code_on_mutable_classes
82
  bool operator ==(Object other) {
83
    if (other is! WindowsOptions || other.runtimeType != runtimeType) {
×
84
      return false;
85
    }
86
    if (identical(this, other)) {
87
      return true;
88
    }
89
    return _deepEquals(encode(), other.encode());
×
90
  }
91

92
  @override
×
93
  // ignore: avoid_equals_and_hash_code_on_mutable_classes
NEW
94
  int get hashCode => Object.hashAll(_toList());
×
95
}
96

97
class _PigeonCodec extends StandardMessageCodec {
98
  const _PigeonCodec();
6✔
99
  @override
×
100
  void writeValue(WriteBuffer buffer, Object? value) {
101
    if (value is int) {
×
102
      buffer.putUint8(4);
×
103
      buffer.putInt64(value);
×
NEW
104
    } else if (value is WindowsOptions) {
×
105
      buffer.putUint8(129);
×
106
      writeValue(buffer, value.encode());
×
107
    } else {
108
      super.writeValue(buffer, value);
×
109
    }
110
  }
111

112
  @override
×
113
  Object? readValueOfType(int type, ReadBuffer buffer) {
114
    switch (type) {
NEW
115
      case 129:
×
116
        return WindowsOptions.decode(readValue(buffer)!);
×
117
      default:
118
        return super.readValueOfType(type, buffer);
×
119
    }
120
  }
121
}
122

123
class PlatformAuthenticator {
124
  /// Constructor for [PlatformAuthenticator].  The [binaryMessenger] named argument is
125
  /// available for dependency injection.  If it is left null, the default
126
  /// BinaryMessenger will be used which routes to the host platform.
NEW
127
  PlatformAuthenticator({
×
128
    BinaryMessenger? binaryMessenger,
129
    String messageChannelSuffix = '',
130
  }) : pigeonVar_binaryMessenger = binaryMessenger,
131
       pigeonVar_messageChannelSuffix =
NEW
132
           messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
×
133
  final BinaryMessenger? pigeonVar_binaryMessenger;
134

135
  static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
136

137
  final String pigeonVar_messageChannelSuffix;
138

139
  /// Generates a new key pair in the secure element/keystore.
140
  /// Returns the public key as a 65-byte uncompressed byte array (0x04 || X || Y).
141
  /// Throws if generation fails.
142
  Future<Uint8List> createKey(String keyTag, WindowsOptions options) async {
×
143
    final pigeonVar_channelName =
NEW
144
        'dev.flutter.pigeon.web3_signers.PlatformAuthenticator.createKey$pigeonVar_messageChannelSuffix';
×
145
    final pigeonVar_channel = BasicMessageChannel<Object?>(
×
146
      pigeonVar_channelName,
147
      pigeonChannelCodec,
148
      binaryMessenger: pigeonVar_binaryMessenger,
×
149
    );
NEW
150
    final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
×
NEW
151
      <Object?>[keyTag, options],
×
152
    );
153
    final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
154
    if (pigeonVar_replyList == null) {
155
      throw _createConnectionError(pigeonVar_channelName);
×
156
    } else if (pigeonVar_replyList.length > 1) {
×
157
      throw PlatformException(
×
158
        code: pigeonVar_replyList[0]! as String,
×
159
        message: pigeonVar_replyList[1] as String?,
×
160
        details: pigeonVar_replyList[2],
×
161
      );
162
    } else if (pigeonVar_replyList[0] == null) {
×
163
      throw PlatformException(
×
164
        code: 'null-error',
165
        message: 'Host platform returned null value for non-null return value.',
166
      );
167
    } else {
168
      return (pigeonVar_replyList[0] as Uint8List?)!;
×
169
    }
170
  }
171

172
  /// Deletes the key associated with the given tag.
173
  Future<void> deleteKey(String keyTag) async {
×
174
    final pigeonVar_channelName =
NEW
175
        'dev.flutter.pigeon.web3_signers.PlatformAuthenticator.deleteKey$pigeonVar_messageChannelSuffix';
×
176
    final pigeonVar_channel = BasicMessageChannel<Object?>(
×
177
      pigeonVar_channelName,
178
      pigeonChannelCodec,
179
      binaryMessenger: pigeonVar_binaryMessenger,
×
180
    );
NEW
181
    final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
×
NEW
182
      <Object?>[keyTag],
×
183
    );
184
    final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
185
    if (pigeonVar_replyList == null) {
186
      throw _createConnectionError(pigeonVar_channelName);
×
187
    } else if (pigeonVar_replyList.length > 1) {
×
188
      throw PlatformException(
×
189
        code: pigeonVar_replyList[0]! as String,
×
190
        message: pigeonVar_replyList[1] as String?,
×
191
        details: pigeonVar_replyList[2],
×
192
      );
193
    } else {
194
      return;
195
    }
196
  }
197

198
  /// Signs the data using the key associated with the given tag.
199
  /// Returns the signature (R || S) bytes.
NEW
200
  Future<Uint8List> sign(
×
201
    String keyTag,
202
    Uint8List data,
203
    WindowsOptions options,
204
  ) async {
205
    final pigeonVar_channelName =
NEW
206
        'dev.flutter.pigeon.web3_signers.PlatformAuthenticator.sign$pigeonVar_messageChannelSuffix';
×
207
    final pigeonVar_channel = BasicMessageChannel<Object?>(
×
208
      pigeonVar_channelName,
209
      pigeonChannelCodec,
210
      binaryMessenger: pigeonVar_binaryMessenger,
×
211
    );
NEW
212
    final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
×
NEW
213
      <Object?>[keyTag, data, options],
×
214
    );
215
    final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
216
    if (pigeonVar_replyList == null) {
217
      throw _createConnectionError(pigeonVar_channelName);
×
218
    } else if (pigeonVar_replyList.length > 1) {
×
219
      throw PlatformException(
×
220
        code: pigeonVar_replyList[0]! as String,
×
221
        message: pigeonVar_replyList[1] as String?,
×
222
        details: pigeonVar_replyList[2],
×
223
      );
224
    } else if (pigeonVar_replyList[0] == null) {
×
225
      throw PlatformException(
×
226
        code: 'null-error',
227
        message: 'Host platform returned null value for non-null return value.',
228
      );
229
    } else {
230
      return (pigeonVar_replyList[0] as Uint8List?)!;
×
231
    }
232
  }
233

234
  /// Retrieves the public key for the given tag.
235
  /// Returns 65-byte uncompressed public key.
236
  Future<Uint8List?> getPublicKey(String keyTag) async {
×
237
    final pigeonVar_channelName =
NEW
238
        'dev.flutter.pigeon.web3_signers.PlatformAuthenticator.getPublicKey$pigeonVar_messageChannelSuffix';
×
239
    final pigeonVar_channel = BasicMessageChannel<Object?>(
×
240
      pigeonVar_channelName,
241
      pigeonChannelCodec,
242
      binaryMessenger: pigeonVar_binaryMessenger,
×
243
    );
NEW
244
    final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
×
NEW
245
      <Object?>[keyTag],
×
246
    );
247
    final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
248
    if (pigeonVar_replyList == null) {
249
      throw _createConnectionError(pigeonVar_channelName);
×
250
    } else if (pigeonVar_replyList.length > 1) {
×
251
      throw PlatformException(
×
252
        code: pigeonVar_replyList[0]! as String,
×
253
        message: pigeonVar_replyList[1] as String?,
×
254
        details: pigeonVar_replyList[2],
×
255
      );
256
    } else {
257
      return (pigeonVar_replyList[0] as Uint8List?);
×
258
    }
259
  }
260
}
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