encode method Null safety
- KeyedArchive object
Implementation
@override
@mustCallSuper
void encode(KeyedArchive object) {
final invalidKeys = extensions.keys
.where((key) => !key.startsWith("x-"))
.map((key) => "'$key'")
.toList();
if (invalidKeys.isNotEmpty) {
throw ArgumentError(
"extension keys must start with 'x-'. The following keys are invalid: ${invalidKeys.join(", ")}",
);
}
extensions.forEach((key, value) {
object.encode(key, value);
});
}