popBack function

void popBack(
  1. Future navigator, {
  2. bool nullBack = false,
  3. bool useMaybePop = false,
})

pop 返回简写 带参数 nullBack =true navigator 返回为空 就继续返回上一页面

Implementation

void popBack(Future<dynamic> navigator,
    {bool nullBack = false, bool useMaybePop = false}) {
  final Future<dynamic> future = navigator;
  future.then((dynamic value) {
    if (nullBack) {
      pop(value, useMaybePop);
    } else {
      if (value != null) pop(value, useMaybePop);
    }
  });
}