AddDiaryEntryPage class
A screen that allows users to add a new diary entry to their travel journal.
Users can input a title, description, date, and location, as well as attach up to five photos. The screen supports geolocation and provides an AI-assisted writer to help generate descriptions.
The entry is saved both to Firestore (via DiaryService) and to the local SQLite database (via LocalDiaryDatabase).
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- AddDiaryEntryPage
Constructors
-
AddDiaryEntryPage({Key? key, required void onSave()?, required void switchToCameraScreen()?, required void switchToDiaryScreen()?, required void deletePhoto(String photoPath)?, required TextEditingController titleController, required TextEditingController descriptionController, required TextEditingController locationController, required TextEditingController dateController, required bool isAiGenerated, required void onAiGeneratedChanged(bool)?, List<
String> initialPhotoUrls = const []}) - Creates a page to add a new diary entry.
Properties
- dateController → TextEditingController
-
Controller for the date input field.
final
- deletePhoto → void Function(String photoPath)?
-
Callback to delete a specific photo.
final
- descriptionController → TextEditingController
-
Controller for the description input field.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
initialPhotoUrls
→ List<
String> -
List of image paths to prepopulate the photo carousel.
final
- isAiGenerated ↔ bool
-
Whether the description was generated using AI.
getter/setter pair
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- locationController → TextEditingController
-
Controller for the location input field.
final
- onAiGeneratedChanged → void Function(bool)?
-
Called when the AI-generated state is toggled.
final
- onSave → void Function()?
-
Callback executed after a successful save.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- switchToCameraScreen → void Function()?
-
Callback to switch to the camera screen.
final
- switchToDiaryScreen → void Function()?
-
Callback to return to the diary screen.
final
- titleController → TextEditingController
-
Controller for the title input field.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< AddDiaryEntryPage> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited