add static method

dynamic add(
  1. V2TimMessage msg,
  2. int removeTime,
  3. Function cb
)

Implementation

static add(V2TimMessage msg, int removeTime, Function cb) {
  queue.addTask(() async {
    giftQueue.add(msg);
    cb();
    await Future.delayed(Duration(milliseconds: removeTime));
    giftQueue.removeWhere((element) => element == msg);
    cb();
  });
}