updateContent static method

bool updateContent({
  1. Widget? child,
  2. Color? bubbleColor,
  3. double? backgroundOverlayLayerOpacity,
  4. double? floatingVerticalPadding,
  5. bool? shouldActiveOnLongPressOnAllPlatforms,
  6. Offset? positionOverride,
  7. bool? shouldIgnorePointer,
})

Updates the currently active bubble's content properties.

Use this to reactively update bubble properties while it's displayed, such as changing shouldIgnorePointer when a toggle changes.

Only updates if a bubble is currently active. Returns true if the update was applied, false if no bubble is active.

Example:

BubbleLabel.updateContent(shouldIgnorePointer: newValue);

Implementation

static bool updateContent({
  Widget? child,
  Color? bubbleColor,
  double? backgroundOverlayLayerOpacity,
  double? floatingVerticalPadding,
  bool? shouldActiveOnLongPressOnAllPlatforms,
  Offset? positionOverride,
  bool? shouldIgnorePointer,
}) {
  if (!isActive || controller.state == null) {
    return false;
  }

  final currentContent = controller.state!;
  controller.state = currentContent.copyWith(
    child: child,
    bubbleColor: bubbleColor,
    backgroundOverlayLayerOpacity: backgroundOverlayLayerOpacity,
    floatingVerticalPadding: floatingVerticalPadding,
    shouldActiveOnLongPressOnAllPlatforms:
        shouldActiveOnLongPressOnAllPlatforms,
    positionOverride: positionOverride,
    shouldIgnorePointer: shouldIgnorePointer,
  );
  return true;
}