Skip to content

A Flutter package of Hacker News API for accessing top and new stories.

License

Notifications You must be signed in to change notification settings

MarsadMaqsood/hackernews_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Version Tag

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

newsType → NewsType

NewsType

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<int>
dead bool
descendants int
score int
url String
parts int

📙 How To Use

HackerNews news = HackerNews(
    newsType: NewsType.newStories,
);

//get stories
List<Story> story = await news.getStories();

//get List of story ids
final storyIds = await news.getStoryIds();

//get story data
final story = await news.getStory(storyIds[0]);