Achieve your goals and keep your data private with Lotti. This life tracking app is designed to help you stay motivated and on track, all while keeping your personal information safe and secure. Now with on-device speech recognition.
GNU General Public License v3.0
501
stars
52
forks
source link
feat: update editor content when entry updated outside editor #1846
This pull request includes several changes to the journal feature, focusing on improving the toolbar widget and its interaction with the entry controller. The most important changes include adding state management for animation completion, updating the toolbar widget to use a consumer widget, and ensuring the entry controller handles unsaved entries correctly.
lib/services/editor_state_service.dart: Added entryIsUnsaved method to check if an entry is unsaved, facilitating better state handling in the entry controller.
Miscellaneous:
pubspec.yaml: Updated the version number of the project.
This pull request includes several changes to the
journal
feature, focusing on improving the toolbar widget and its interaction with the entry controller. The most important changes include adding state management for animation completion, updating the toolbar widget to use a consumer widget, and ensuring the entry controller handles unsaved entries correctly.State Management and Animation:
lib/features/journal/state/entry_controller.dart
: Added abool animationCompleted
field to manage the animation state of the toolbar widget.Toolbar Widget Updates:
lib/features/journal/ui/widgets/editor/editor_toolbar.dart
: UpdatedToolbarWidget
to extendConsumerWidget
instead ofStatelessWidget
, allowing it to interact with the entry controller and manage animations based on state. [1] [2] [3]lib/features/journal/ui/widgets/editor/editor_widget.dart
: ModifiedEditorWidget
to passentryId
toToolbarWidget
to support the new interaction model.Entry Controller Enhancements:
lib/features/journal/state/entry_controller.dart
: Added logic to set the controller if the entry is not dirty and not unsaved, ensuring proper state management.lib/services/editor_state_service.dart
: AddedentryIsUnsaved
method to check if an entry is unsaved, facilitating better state handling in the entry controller.Miscellaneous:
pubspec.yaml
: Updated the version number of the project.