Article class

Represents a news article retrieved from the News API.

Constructors

Article(Source source, String? author, String? title, String? description, String? url, String? urlToImage, String? publishedAt, String? content)
Creates an Article instance with the provided details.
Article.fromJson(Map<String, dynamic> json)
Creates an Article object from a JSON map.
factory

Properties

author String?
The author of the article.
final
content String?
The full content of the article (if available).
final
description String?
A short description or summary of the article.
final
hashCode int
The hash code for this object.
no setterinherited
publishedAt String?
The publication date and time of the article in ISO 8601 format.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source Source
The source of the article.
final
title String?
The title of the article.
final
url String?
The direct URL to the article.
final
urlToImage String?
The URL of the article’s image (if available).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

parseList(dynamic list) List<Article>
Parses a list of JSON objects into a list of Article instances. Returns an empty list if list is null, not a list, or empty.