replaceMultipleKind method

Wildness replaceMultipleKind({
  1. required Map<Type, WildnessBase> kinds,
})

Replace all kinds provide.

If the kind exist already in wildness components change the value of the map.key for the current value of map.value. You can replace one by one using replaceKind, however if you only want to change a kind in the current context must be recomendated to use wildness(KindToReplace)Theme.

Usually use in wildnessAnimatedTheme widget.

Implementation

Wildness replaceMultipleKind({
  required Map<Type, WildnessBase<dynamic>> kinds,
}) {
  //Check if the component kind exists in the provide theme components
  for (MapEntry<Type, WildnessBase<dynamic>> kind in kinds.entries) {
    assert(
      components[kind.key]?.runtimeType != null,
      "Kind must be the same Type or Covariant as the replacemente kind",
    );
  }
  //Return copyWith of the [wildnessThemeData] components must be unmodifiable
  //for being sure of no modifications and no repit hash
  return copyWith(
    components: Map.unmodifiable(Map.from(components)..addAll(kinds)),
  );
}