Created
January 13, 2020 18:00
-
-
Save azamsharp/24270e681a69d950ccbbd867c0fd5b08 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Future<void> load() async { | |
| final list = await Future.wait([Webservice().getStocks(), Webservice().getTopNews()]); | |
| stocks = list.first.map((stock) => StockViewModel(stock: stock)).toList(); // stocks | |
| newsArticles = list.last.map((newsArticle) => NewsArticleViewModel(newsArticle: newsArticle)).toList(); // news articles | |
| notifyListeners(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment