Giter VIP home page Giter VIP logo

Comments (5)

xdd666t avatar xdd666t commented on June 12, 2024

比如首页 数据没请求完成页面渲染了

通过网络去请求数据,页面肯定在请求到数据前初始化页面。当获取到数据后,将数据存到state里的变量,在通过action里面定义的方法,通知reducer更新页面就行了。我懂你的意思,你应该是用本地json做demo的,实际上你去看看reducer里面的实现,你发现数据改动后,更新页面的操作非常简单

from flutter_wan.

Luffys6 avatar Luffys6 commented on June 12, 2024

不是这样吧,我现在处理的是,在页面判断数据没获取到先整页显示loading

from flutter_wan.

Luffys6 avatar Luffys6 commented on June 12, 2024

我不是本地的json,我就是网络请求的,reducer里面更新状态的

from flutter_wan.

xdd666t avatar xdd666t commented on June 12, 2024

我不是本地的json,我就是网络请求的,reducer里面更新状态的

没问题啊,开始请求的时候开启loading,数据请求成功后关闭loading,然后在reducer里面更新数据就行了,页面数据会自动刷新的,对了你在reducer里面更新的state里的变量,需要你在view里面使用

from flutter_wan.

xdd666t avatar xdd666t commented on June 12, 2024

我不是本地的json,我就是网络请求的,reducer里面更新状态的

没问题啊,开始请求的时候开启loading,数据请求成功后关闭loading,然后在reducer里面更新数据就行了,页面数据会自动刷新的,对了你在reducer里面更新的state里的变量,需要你在view里面使用

嗯 这我明白,我看你写的没加Loading啊,你看看你首页数据,你加下我759902931

首页我用了这个flutter_easyrefresh下拉刷新 上拉加载的库,没用loading布局。。。。

from flutter_wan.

Related Issues (2)

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.