put<T> method
Insert an Instance into the hashmap
autoRemove
set this value to true when you want to remove
this dependency when the route who creates this dependency
is popped
onRemove
callback to be called when this dependency is removed
Implementation
void put<T>(
T value, {
String? tag,
bool autoRemove = false,
_RemoveCallback<T>? onRemove,
}) {
final key = _getKey(T, tag);
_vars[key] = Singleton<T>(
value,
autoRemove: autoRemove,
onRemove: onRemove,
);
}