addStickerToRecentlyUsed method

Future addStickerToRecentlyUsed({
  1. required GlobalKey<StickerPickerWidgetState> key,
  2. required Sticker sticker,
  3. KeyboardConfig keyboardConfig = const KeyboardConfig(),
})

Add a sticker to recently used list or increase its counter

Implementation

Future addStickerToRecentlyUsed({
  required GlobalKey<StickerPickerWidgetState> key,
  required Sticker sticker,
  KeyboardConfig keyboardConfig = const KeyboardConfig(),
}) async {
  return StickerPickerInternalUtils()
      .addStickerToRecentlyUsed(sticker: sticker, config: keyboardConfig)
      .then((recentStickerList) =>
          key.currentState?.updateRecentSticker(recentStickerList));
}