浏览代码

Merge pull request #245 from Unity-Technologies/fix_sliver_bug

remove duplicated willPop()
/main
GitHub 3 年前
当前提交
b8c5a0c7
共有 1 个文件被更改,包括 0 次插入16 次删除
  1. 16
      com.unity.uiwidgets/Runtime/widgets/routes.cs

16
com.unity.uiwidgets/Runtime/widgets/routes.cs


_ModalScopeStatus widget = context.dependOnInheritedWidgetOfExactType<_ModalScopeStatus>();
return widget?.route as ModalRoute<T>;
}
public new GlobalKey<_ModalScopeState<T>> _scopeKey = new LabeledGlobalKey<_ModalScopeState<T>>();
public override Future<RoutePopDisposition> willPop() {
//async
_ModalScopeState<T> scope = _scopeKey.currentState as _ModalScopeState<T> ;
D.assert(scope != null);
bool result = false;
foreach (WillPopCallback callback in _willPopCallbacks) {
callback.Invoke().then(v => result = !(bool)v);
if (result) {
return Future.value(RoutePopDisposition.doNotPop).to<RoutePopDisposition>();
}
}
return base.willPop();
}
public override Widget _buildModalScope(BuildContext context) {
return _modalScopeCache = _modalScopeCache ?? new _ModalScope<T>(key: _scopeKey, route: this);
}

正在加载...
取消
保存