withEntry<T extends ContextEntry> method
Create a Context with entry
added to the existing entries.
Implementation
Context withEntry<T extends ContextEntry>(T? entry) {
if (entry != null && T != entry.runtimeType) {
throw ArgumentError.value(
entry,
"entry",
"must be exactly of type '${T}'",
);
}
return Context.fromMap(
<Type, ContextEntry?>{
..._context,
T: entry,
},
);
}