markIsComposing method

Future markIsComposing({
  1. required String phone,
  2. int timeout = 5000,
})

Implementation

Future markIsComposing({required String phone, int timeout = 5000}) async {
  await wpClient.evaluateJs(
    '''window.WPP.chat.markIsComposing(${phone.phoneParse});''',
    methodName: "markIsComposing",
  );

  // Wait for the timeout period.
  await Future.delayed(Duration(milliseconds: timeout));

  // Mark the chat as paused.
  await wpClient.evaluateJs(
    '''window.WPP.chat.markIsPaused(${phone.phoneParse});''',
    methodName: "markIsPaused",
  );
}