Created
January 21, 2019 20:14
-
-
Save felangel/c876cc4832e951c5856a7a3c6bfeea87 to your computer and use it in GitHub Desktop.
[github_search] Search Result Model
This file contains 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
import 'package:common_github_search/common_github_search.dart'; | |
class SearchResult { | |
final List<SearchResultItem> items; | |
const SearchResult({this.items}); | |
static SearchResult fromJson(Map<String, dynamic> json) { | |
final items = (json['items'] as List<dynamic>) | |
.map((dynamic item) => | |
SearchResultItem.fromJson(item as Map<String, dynamic>)) | |
.toList(); | |
return SearchResult(items: items); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment