我正在使用Flutter Preview 1

时间:2018-08-25 15:40:54

标签: dart flutter

根据Google的介绍,Flutter Preview版本1可用:

Preview Release 1 post on medium

我使用 BETA 0.5.1 开始了一个项目。

如果我从Android Studio中升级Flutter,它将停留在0.5.1版:

[✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.13.6 17G65, locale de-DE)
  • 0.5.1实际上是Flutter Preview 1吗?
  • 我应该升级我的项目吗?如何以及为什么?

2 个答案:

答案 0 :(得分:2)

要在您的频道 中获取最新版本,请始终运行func fetchTopStories(){ let moc = coreData.persistentContainer.viewContext let myUrlString = "https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty" guard let newsUrl = URL(string: myUrlString) else { return } URLSession.shared.dataTask(with: newsUrl) { (data, responce, err) in if err != nil{ print("err in fetching data") return } else { guard let myData = data else{return} guard let jsonResult = try! JSONSerialization.jsonObject(with: myData, options: .mutableContainers) as? [Int] else{return} for i in 0..<jsonResult.count { let myString = "https://hacker-news.firebaseio.com/v0/item/\(jsonResult[i]).json?print=pretty" guard let myUrl = URL(string: myString) else { return } URLSession.shared.dataTask(with: myUrl, completionHandler: { (data, responce, err) in if err != nil{ print("err in fetching data") return } else { guard let allData = try? JSONSerialization.jsonObject(with: data!, options: .mutableContainers) as? NSDictionary else{return} let news = News(context: moc) if let newTitle = (allData!["title"]) as? String{ news.title = newTitle } if let newScore = (allData!["score"]) as? Int{ news.score = Int16(newScore) } if let newId = (allData!["id"]) as? String{ news.id = Int64(newId)! } if let newText = (allData!["text"]) as? String{ news.text = newText } if let newUrl = (allData!["url"]) as? String{ news.url = newUrl } } }).resume() } } }.resume() self.coreData.saveContext() }
如果要切换到较新(且更不稳定)的频道,可以运行flutter upgradeflutter channel dev

运行flutter channel master会向您显示所有可用频道:

  • flutter channel

  • beta

  • dev

答案 1 :(得分:1)

如果您正在寻找1.0.0之前的版本,则不会。没有了。

当前8月25日的主版本在主频道上为0.7.1-pre.26

您可以运行flutter upgrade移至更高版本。 您还可以使用flutter channel master来打开主分支