addSkinToneTargetIfAvailable method

Widget addSkinToneTargetIfAvailable({
  1. required bool hasSkinTone,
  2. required String linkKey,
  3. required Widget child,
})

Add target for skin tone overlay if skin tone is available

Implementation

Widget addSkinToneTargetIfAvailable({
  required bool hasSkinTone,
  required String linkKey,
  required Widget child,
}) {
  if (hasSkinTone) {
    final link = links.putIfAbsent(linkKey, LayerLink.new);
    return CompositedTransformTarget(
      link: link,
      child: child,
    );
  }
  return child;
}