TopHeadlines class
Top headlines
This endpoint provides live top and breaking headlines for a country, single source, or multiple sources. You can also use a query to search with keywords. You can also set a category as well as a language. Articles are sorted by the earliest date first. This endpoint is great for retrieving headlines for display on news tickers or similar.
All parameters passed to TopHeadlines are optional, but you need to include at least one of them.
Constructors
-
TopHeadlines({List<
String> sources, String query, Categories category, String language, String country })
Properties
- category → Categories
-
final
- country → String
-
final
- language → String
-
final
-
parameters
→ Map<
String, dynamic> -
read-only
- query → String
-
final
-
sources
→ List<
String> -
final
- url → String
-
read-only
- client → Client
-
final, inherited
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
request(
String apiKey) → Future< Map< String, dynamic> > -
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited