Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ enum AuthenticatorTransport {
@JsonValue('usb')
Usb,
@JsonValue('bluetooth')
Bluetooth;
Bluetooth,
@JsonValue('ble')
BluetoothLowEnergy;
Comment on lines +101 to +103
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make more sense to have one enum :

It should still be backwards compatible as the entry point for users would be the factory function and the switch logic .

@JsonValue('bluetooth')
  Bluetooth;

factory AuthenticatorTransport.fromPlatformType(String value) {
switch (value) {
return AuthenticatorTransport.Nfc;
case 'bluetooth':
return AuthenticatorTransport.Bluetooth;
      case 'ble':
        return AuthenticatorTransport.Bluetooth;


factory AuthenticatorTransport.fromPlatformType(String value) {
switch (value) {
Expand All @@ -112,6 +114,8 @@ enum AuthenticatorTransport {
return AuthenticatorTransport.Nfc;
case 'bluetooth':
return AuthenticatorTransport.Bluetooth;
case 'ble':
return AuthenticatorTransport.BluetoothLowEnergy;
default:
throw ArgumentError.value(value);
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.