Giter VIP home page Giter VIP logo

Comments (5)

xxNull-lsk avatar xxNull-lsk commented on June 6, 2024

把AppUpgrade.appUpgrade放到setState里面应该就没有这个问题了。例如:
setState(() {
AppUpgrade.appUpgrade(context, getUpgradeInfo, cancelText: '以后再说', okText: '马上升级');
});

from flutter-do.

MakenChan avatar MakenChan commented on June 6, 2024

用ctrl+shift+\方式刷新的时候app启动会弹框出来说更新
用debug模式也会弹出来
但是将app安装在手机上然后重新打开的时候并没有什么反应,不知道为什么。但是切换到后台然后再切回来会立马又弹出来,不知道为什么
image
加上这一句就会出现这个问题
@781238222

我也遇到这个问题,因为请求是异步的,请问怎么解决的这里

from flutter-do.

MakenChan avatar MakenChan commented on June 6, 2024

getUpgradeInfo

请问加在那个state里面,加了也还是一样,首页不出来,要点击或者切换后台才会弹出一个升级框

from flutter-do.

MakenChan avatar MakenChan commented on June 6, 2024

可以这样解决,启动的时候先加载值设置为静态,使用的时候取值
void main() {
realRunApp();
}
void realRunApp() async {
//初始化升级
await SpUtils.getInstance();
runApp(MyApp());
}

SpUtils.dart
class SpUtils {
static Map result;
static AppInfo appInfo;

static Future getInstance() async {
result = await NetUtils.request(Constants.SERVER_URL+"/api/basis-app/version/latest");
return true;
}

static Future getInstanceInfo() async {
appInfo = await FlutterUpgrade.appInfo;
return true;
}
}

from flutter-do.

LaoMengFlutter avatar LaoMengFlutter commented on June 6, 2024

1.1.0版本已经修复

from flutter-do.

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.