delayedBack method

void delayedBack({
  1. int seconds = 2,
  2. dynamic result,
})

延时退出

Implementation

void delayedBack({int seconds = 2, result}) {
  Future.delayed(Duration(seconds: seconds), () {
    if (result != null) {
      Get.back(result: result);
    } else {
      Get.back();
    }
  });
}