DiaryCard class

Represents a summarized version of a diary entry, typically used for preview cards or lists.

Contains minimal information: ID, date, place name, a short description, and a representative image URL.

Constructors

DiaryCard({required String id, required DateTime date, required String title, required String place, required String imageUrl})
Creates a DiaryCard with the given fields.
DiaryCard.fromJson(Map<String, dynamic> json)
Creates a DiaryCard from a JSON map.
factory
DiaryCard.fromMap(String id, Map<String, dynamic> map)
Creates a DiaryCard from a Firestore document map.
factory

Properties

date DateTime
Date and time when the entry was created or refers to.
final
hashCode int
The hash code for this object.
no setterinherited
id String
Unique identifier of the diary entry.
final
imageUrl String
URL of a representative photo associated with the entry.
final
place String
Human-readable place name (e.g., city or landmark).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String
A short description or summary of the entry.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts this model into a JSON map, including the ID.
toMap() Map<String, dynamic>
Converts this model into a map format for saving to Firestore.
toString() String
A string representation of this object.
inherited

Operators

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