hackernews_api
所属分类:Dart语言编程
开发工具:Dart
文件大小:0KB
下载次数:0
上传日期:2024-01-22 19:37:41
上 传 者:
sh-1993
说明: 黑客新闻API的Flutter包,用于访问热门新闻和新新闻。
(A Flutter package of Hacker News API for accessing top and new stories.)
文件列表:
example/
lib/
test/
.metadata
CHANGELOG.md
LICENSE
analysis_options.yaml
pubspec.yaml
[![Version](https://img.shields.io/pub/v/hackernews_api?color=%2354C92F&logo=dart)](https://pub.dev/packages/hackernews_api/install) [![Tag](https://img.shields.io/badge/Flutter-Hacker%20News-%23212C39)](https://github.com/MarsadMaqsood/hackernews_api)
A Flutter package of Hacker News API for accessing top and new stories.
## Installing
```
dependencies:
hackernews_api: ^0.0.6
```
## Import
```
import 'package:hackernews_api/hackernews_api.dart';
```
## Properties
```dart
newsType → NewsType
```
## NewsType
```dart
NewsType.topStories
NewsType.newStories
NewsType.askStories
NewsType.showStories
NewsType.jobStories
```
## Properties
| | Type | Story | Poll | Comment |
| --- | --- | --- | --- | --- |
|id | `int` | | | |
|text | `String` | | | |
|title | `String` | | | |
|parent | `int` | | | |
|deleted | `bool` | | | |
|type | `String` | | | |
|by | `String` | | | |
|time | `int` | | | |
|kids | `List` | | | |
|dead | `bool` | | | |
|descendants | `int` | | | |
|score | `int` | | | |
|url | `String` | | | |
|parts | `int` | | | |
## How To Use
```dart
HackerNews news = HackerNews(
newsType: NewsType.newStories,
);
//get stories
List story = await news.getStories();
//get List of story ids
final storyIds = await news.getStoryIds();
//get story data
final story = await news.getStory(storyIds[0]);
```
近期下载者:
相关文件:
收藏者: