filterSheetAutoAnimation method

void filterSheetAutoAnimation(
  1. bool up,
  2. Function setState
)

Animates the WhatsApp filter sheet.

If up is true, it animates the sheet upwards. Otherwise, it animates the sheet downwards.

Implementation

void filterSheetAutoAnimation(bool up, Function setState) async {
  if (up) {
    while (filterShowHelper < 120) {
      filterShowHelper += 4;
      setState(() {});
      await Future.delayed(const Duration(milliseconds: 1));
    }
  } else {
    while (filterShowHelper > 0) {
      filterShowHelper -= 4;
      setState(() {});
      await Future.delayed(const Duration(milliseconds: 1));
    }
  }
}