根据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 :(得分: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 upgrade
或flutter 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
来打开主分支