startBubble method

Future<bool> startBubble({
  1. BubbleOptions? bubbleOptions,
  2. NotificationOptions? notificationOptions,
  3. dynamic onTap()?,
  4. dynamic onTapDown(
    1. double x,
    2. double y
    )?,
  5. dynamic onTapUp(
    1. double x,
    2. double y
    )?,
  6. dynamic onMove(
    1. double x,
    2. double y
    )?,
})

Start the bubble.

Returns true if the bubble is started successfully, false otherwise.

If the bubble is already running or the permission is not granted, this method will return false.

options is and optional parameter that allows you to customize the bubble.

onTap is an optional callback that will be called when the bubble is tapped.

onTapDown is an optional callback that will be called when the bubble is tapped down (pressed), it will receive the x and y coordinates of the bubble when it is tapped down (pressed).

onTapUp is an optional callback that will be called when the bubble is tapped up (released), it will receive the x and y coordinates of the bubble when it is tapped up (released).

onMove is an optional callback that will be called when the bubble is moved, it will receive the new x and y coordinates of the bubble after it is moved.

Implementation

Future<bool> startBubble({
  BubbleOptions? bubbleOptions,
  NotificationOptions? notificationOptions,
  Function()? onTap,
  Function(double x, double y)? onTapDown,
  Function(double x, double y)? onTapUp,
  Function(double x, double y)? onMove,
}) {
  return DashBubblePlatform.instance.startBubble(
    bubbleOptions: bubbleOptions,
    notificationOptions: notificationOptions,
    onTap: onTap,
    onTapDown: onTapDown,
    onTapUp: onTapUp,
    onMove: onMove,
  );
}