decode static method
- Unpacker u
Implementation
static LocalSecret? decode(Unpacker u) {
try {
switch (u.unpackString()) {
case null: return null;
default: throw DecodeError();
}
} on FormatException {
if (u.unpackMapLength() != 1) throw DecodeError();
switch (u.unpackString()) {
case "Password":
return LocalSecretPassword(
(Password.decode(u))!,
);
case "SecretKey":
return LocalSecretSecretKey(
(SecretKey.decode(u))!,
);
case null: return null;
default: throw DecodeError();
}
}
}