Giter Site home page Giter Site logo

Comments (9)

simplezhli avatar simplezhli commented on June 1, 2024

根据你的描述,还有我看到LoginPage在请求时才触发dispose。感觉和这里有点关系。dispose里是不是有CancelToken的cancel。

from flutter_deer.

simplezhli avatar simplezhli commented on June 1, 2024

我找了3.16.9版本,也是类似。
image

from flutter_deer.

dasewan avatar dasewan commented on June 1, 2024

是呀大佬,为什么登录页面已经跳转首页了,首页initState后,登录页才dispose呢,然后登录页就把首页的接口请求给cancel了。升级前好好的

from flutter_deer.

dasewan avatar dasewan commented on June 1, 2024

从表现看来,NavigatorUtils.push(context, Routes.home, clearStack: true);这个会触发dispose。而不加clearStack: true参数,就不会触发dispose。但是这个生命周期的顺序令人迷惑

from flutter_deer.

simplezhli avatar simplezhli commented on June 1, 2024

你试试addPostFrameCallback请求接口时,再延时一点看会不会有这个问题,

from flutter_deer.

simplezhli avatar simplezhli commented on June 1, 2024

我看了一下3.10.6,也是这个顺序,所以有点不清楚问题的原因了,哈哈。

from flutter_deer.

dasewan avatar dasewan commented on June 1, 2024

image
您是这个意思吗?这样确实可以屏蔽这个问题,但是两个页面的生命周期还是错乱的

from flutter_deer.

simplezhli avatar simplezhli commented on June 1, 2024

也不算错乱,安装原生也是类似的。打开一个页面的同时,上个页面finish触发onDestroy就在新页面创建以后。比较奇怪的是上个页面的CancelToken为什么会影响新页面。这两个页面也不是一个CancelToken对象。

from flutter_deer.

dasewan avatar dasewan commented on June 1, 2024

谢谢

from flutter_deer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.