From 7725233e058e5b7ff182ae23c5812b1fd591a7e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Chiotti?= <44336112+maelchiotti@users.noreply.github.com> Date: Fri, 13 Jun 2025 09:57:29 +0200 Subject: [PATCH 1/9] [471] Fix undo/redo (#472) * [471] misc: fix android build * [471] fix: undo/redo unavailable * [471] misc: update flutter/dart versions * [471] misc: format --- .ndk-version | 2 +- android/app/build.gradle | 8 +- android/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 4 +- android/settings.gradle | 2 +- lib/common/actions/notes/delete.dart | 16 +- lib/common/dialogs/confirmation_dialog.dart | 17 +- .../app_bars/notes/editor_app_bar.dart | 185 ++++++++---------- .../app_bars/notes/notes_app_bar.dart | 84 ++++---- .../selection/notes_selection_app_bar.dart | 53 +++-- .../editor/editor_archived_menu_option.dart | 5 +- .../editor/editor_available_menu_option.dart | 5 +- .../notes/selection_archived_menu_option.dart | 5 +- .../selection_available_menu_option.dart | 5 +- lib/common/navigation/top_navigation.dart | 23 ++- .../swipe_actions/deleted_swipe_action.dart | 14 +- lib/common/ui/snack_bar_utils.dart | 7 +- lib/common/ui/theme_utils.dart | 53 +++-- lib/common/widgets/notes/note_tile.dart | 63 +++--- lib/common/widgets/notes/notes_list.dart | 38 ++-- .../placeholders/loading_placeholder.dart | 5 +- lib/models/note/types/markdown_note.dart | 14 +- lib/models/note/types/plain_text_note.dart | 14 +- lib/models/note/types/rich_text_note.dart | 14 +- lib/pages/archives/archives_page.dart | 5 +- lib/pages/bin/bin_page.dart | 5 +- lib/pages/bin/widgets/empty_bin_fab.dart | 8 +- .../dialogs/labels_selection_dialog.dart | 47 +++-- lib/pages/editor/editor_page.dart | 10 +- .../widgets/editors/checklist_editor.dart | 7 +- .../widgets/editors/markdown_editor.dart | 58 +++--- .../widgets/editors/plain_text_editor.dart | 27 +-- .../widgets/editors/rich_text_editor.dart | 14 +- .../widgets/toolbar/color_toolbar_button.dart | 5 +- lib/pages/editor/widgets/toolbar/toolbar.dart | 24 +-- lib/pages/labels/dialogs/label_dialog.dart | 11 +- .../labels/enums/label_tile_menu_option.dart | 7 +- lib/pages/labels/labels_page.dart | 19 +- lib/pages/notes/widgets/add_note_fab.dart | 106 +++++----- .../pages/settings_accessibility_page.dart | 5 +- .../pages/settings_appearance_page.dart | 30 ++- .../settings/pages/settings_backup_page.dart | 11 +- .../pages/settings_behavior_page.dart | 69 +++---- .../settings/pages/settings_labels_page.dart | 18 +- .../pages/settings_notes_types_page.dart | 21 +- .../labels/labels/labels_provider.dart | 21 +- lib/providers/notes/notes_provider.dart | 28 ++- lib/providers/notifiers/notifiers.dart | 3 - lib/services/backup/backup_service.dart | 9 +- lib/services/migration/migration_service.dart | 47 +++-- lib/services/notes/notes_service.dart | 17 +- pubspec.lock | 60 +++--- pubspec.yaml | 10 +- 53 files changed, 624 insertions(+), 716 deletions(-) diff --git a/.ndk-version b/.ndk-version index a66c7e72..850be341 100644 --- a/.ndk-version +++ b/.ndk-version @@ -1 +1 @@ -r26d \ No newline at end of file +r27 \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index d80810ca..6b66b725 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -38,15 +38,15 @@ android.applicationVariants.all { variant -> android { namespace = "com.maelchiotti.localmaterialnotes" compileSdk = flutter.compileSdkVersion - ndkVersion = flutter.ndkVersion + ndkVersion = "27.0.12077973" compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 + jvmTarget = JavaVersion.VERSION_11 } dependenciesInfo { diff --git a/android/gradle.properties b/android/gradle.properties index 25971708..f018a618 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 0173110b..d9af622e 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -2,5 +2,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip -distributionSha256Sum=bb09982fdf52718e4c7b25023d10df6d35a5fff969860bdf5a5bd27a3ab27a9e +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip +distributionSha256Sum=2ab88d6de2c23e6adae7363ae6e29cbdd2a709e992929b48b6530fd0c7133bd6 diff --git a/android/settings.gradle b/android/settings.gradle index b9e43bd3..e2be9b48 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -18,7 +18,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "8.1.0" apply false + id "com.android.application" version "8.7.0" apply false id "org.jetbrains.kotlin.android" version "1.8.22" apply false } diff --git a/lib/common/actions/notes/delete.dart b/lib/common/actions/notes/delete.dart index 2b7496a3..2d8813c6 100644 --- a/lib/common/actions/notes/delete.dart +++ b/lib/common/actions/notes/delete.dart @@ -49,11 +49,9 @@ Future deleteNote( SnackBarUtils().show( context, text: context.l.snack_bar_deleted(1), - onCancel: - (globalRef) async => - wasArchived - ? await archiveNote(context, globalRef, note: note, cancel: false) - : await restoreNote(context, globalRef, note: note, cancel: false), + onCancel: (globalRef) async => wasArchived + ? await archiveNote(context, globalRef, note: note, cancel: false) + : await restoreNote(context, globalRef, note: note, cancel: false), ); } @@ -87,11 +85,9 @@ Future deleteNotes(BuildContext context, WidgetRef ref, {required List - wereArchived - ? await archiveNotes(context, ref, notes: notes) - : await restoreNotes(context, globalRef, notes: notes, cancel: false), + onCancel: (globalRef) async => wereArchived + ? await archiveNotes(context, ref, notes: notes) + : await restoreNotes(context, globalRef, notes: notes, cancel: false), ); } diff --git a/lib/common/dialogs/confirmation_dialog.dart b/lib/common/dialogs/confirmation_dialog.dart index 0d5dac12..205f94a1 100644 --- a/lib/common/dialogs/confirmation_dialog.dart +++ b/lib/common/dialogs/confirmation_dialog.dart @@ -12,15 +12,14 @@ Future _showConfirmationDialog(BuildContext context, String title, String await showAdaptiveDialog( context: context, useRootNavigator: false, - builder: - (context) => AlertDialog.adaptive( - title: Text(title), - content: SingleChildScrollView(child: Column(children: [Text(body)])), - actions: [ - TextButton(onPressed: () => Navigator.pop(context, false), child: Text(context.fl.cancelButtonLabel)), - TextButton(onPressed: () => Navigator.pop(context, true), child: Text(confirmText)), - ], - ), + builder: (context) => AlertDialog.adaptive( + title: Text(title), + content: SingleChildScrollView(child: Column(children: [Text(body)])), + actions: [ + TextButton(onPressed: () => Navigator.pop(context, false), child: Text(context.fl.cancelButtonLabel)), + TextButton(onPressed: () => Navigator.pop(context, true), child: Text(confirmText)), + ], + ), ) ?? false; diff --git a/lib/common/navigation/app_bars/notes/editor_app_bar.dart b/lib/common/navigation/app_bars/notes/editor_app_bar.dart index 76cdb7d3..bc1a7a57 100644 --- a/lib/common/navigation/app_bars/notes/editor_app_bar.dart +++ b/lib/common/navigation/app_bars/notes/editor_app_bar.dart @@ -152,107 +152,92 @@ class _BackAppBarState extends ConsumerState { final lockNote = PreferenceKey.lockNote.preferenceOrDefault; return ValueListenableBuilder( - valueListenable: editorHasFocusNotifier, - builder: (context, editorHasFocus, child) { - return ValueListenableBuilder( - valueListenable: isEditModeNotifier, - builder: (context, isEditMode, child) { - return AppBar( - leading: BackButton(), - actions: [ - if (note.status == NoteStatus.available) ...[ - if (note.type == NoteType.richText) ...[ - ValueListenableBuilder( - valueListenable: fleatherControllerCanUndoNotifier, - builder: (context, canUndo, child) { - final enableUndo = - editorHasFocus && - canUndo && - editorController != null && - editorController.canUndo && - isEditMode; - - return IconButton( - icon: const Icon(Icons.undo), - tooltip: context.l.tooltip_undo, - onPressed: enableUndo ? undo : null, - ); - }, - ), - ValueListenableBuilder( - valueListenable: fleatherControllerCanRedoNotifier, - builder: (context, canRedo, child) { - final enableRedo = editorHasFocus && canRedo && isEditMode; - - return IconButton( - icon: const Icon(Icons.redo), - tooltip: context.l.tooltip_redo, - onPressed: enableRedo ? redo : null, - ); - }, - ), - ], - if (showEditorModeButton) - ValueListenableBuilder( - valueListenable: isEditModeNotifier, - builder: - (context, isEditMode, child) => IconButton( - icon: Icon(isEditMode ? Icons.visibility : Icons.edit), - tooltip: - isEditMode - ? context.l.tooltip_fab_toggle_editor_mode_read - : context.l.tooltip_fab_toggle_editor_mode_edit, - onPressed: switchMode, - ), - ), - PopupMenuButton( - itemBuilder: - (context) => ([ - EditorAvailableMenuOption.copy.popupMenuItem(context), - EditorAvailableMenuOption.share.popupMenuItem(context), - const PopupMenuDivider(), - if (note.pinned) EditorAvailableMenuOption.unpin.popupMenuItem(context), - if (!note.pinned) EditorAvailableMenuOption.pin.popupMenuItem(context), - if (lockNote && note.locked) EditorAvailableMenuOption.unlock.popupMenuItem(context), - if (lockNote && !note.locked) EditorAvailableMenuOption.lock.popupMenuItem(context), - if (enableLabels) EditorAvailableMenuOption.selectLabels.popupMenuItem(context), - const PopupMenuDivider(), - EditorAvailableMenuOption.archive.popupMenuItem(context), - EditorAvailableMenuOption.delete.popupMenuItem(context), - const PopupMenuDivider(), - EditorAvailableMenuOption.about.popupMenuItem(context), - ]), - onSelected: onAvailableMenuOptionSelected, - ), - ], - if (note.status == NoteStatus.archived) - PopupMenuButton( - itemBuilder: - (context) => ([ - EditorArchivedMenuOption.copy.popupMenuItem(context), - EditorArchivedMenuOption.share.popupMenuItem(context), - const PopupMenuDivider(), - EditorArchivedMenuOption.unarchive.popupMenuItem(context), - const PopupMenuDivider(), - EditorArchivedMenuOption.about.popupMenuItem(context), - ]), - onSelected: onArchivedMenuOptionSelected, - ), - if (note.status == NoteStatus.deleted) - PopupMenuButton( - itemBuilder: - (context) => ([ - EditorDeletedMenuOption.restore.popupMenuItem(context), - EditorDeletedMenuOption.deletePermanently.popupMenuItem(context), - const PopupMenuDivider(), - EditorDeletedMenuOption.about.popupMenuItem(context), - ]), - onSelected: onDeletedMenuOptionSelected, - ), - Gap(Sizes.appBarEnd.size), + valueListenable: isEditModeNotifier, + builder: (context, isEditMode, child) { + return AppBar( + leading: BackButton(), + actions: [ + if (note.status == NoteStatus.available) ...[ + if (note.type == NoteType.richText) ...[ + ValueListenableBuilder( + valueListenable: fleatherControllerCanUndoNotifier, + builder: (context, canUndo, child) { + final enableUndo = canUndo && editorController != null && isEditMode; + + return IconButton( + icon: const Icon(Icons.undo), + tooltip: context.l.tooltip_undo, + onPressed: enableUndo ? undo : null, + ); + }, + ), + ValueListenableBuilder( + valueListenable: fleatherControllerCanRedoNotifier, + builder: (context, canRedo, child) { + final enableRedo = canRedo && editorController != null && isEditMode; + + return IconButton( + icon: const Icon(Icons.redo), + tooltip: context.l.tooltip_redo, + onPressed: enableRedo ? redo : null, + ); + }, + ), ], - ); - }, + if (showEditorModeButton) + ValueListenableBuilder( + valueListenable: isEditModeNotifier, + builder: (context, isEditMode, child) => IconButton( + icon: Icon(isEditMode ? Icons.visibility : Icons.edit), + tooltip: isEditMode + ? context.l.tooltip_fab_toggle_editor_mode_read + : context.l.tooltip_fab_toggle_editor_mode_edit, + onPressed: switchMode, + ), + ), + PopupMenuButton( + itemBuilder: (context) => ([ + EditorAvailableMenuOption.copy.popupMenuItem(context), + EditorAvailableMenuOption.share.popupMenuItem(context), + const PopupMenuDivider(), + if (note.pinned) EditorAvailableMenuOption.unpin.popupMenuItem(context), + if (!note.pinned) EditorAvailableMenuOption.pin.popupMenuItem(context), + if (lockNote && note.locked) EditorAvailableMenuOption.unlock.popupMenuItem(context), + if (lockNote && !note.locked) EditorAvailableMenuOption.lock.popupMenuItem(context), + if (enableLabels) EditorAvailableMenuOption.selectLabels.popupMenuItem(context), + const PopupMenuDivider(), + EditorAvailableMenuOption.archive.popupMenuItem(context), + EditorAvailableMenuOption.delete.popupMenuItem(context), + const PopupMenuDivider(), + EditorAvailableMenuOption.about.popupMenuItem(context), + ]), + onSelected: onAvailableMenuOptionSelected, + ), + ], + if (note.status == NoteStatus.archived) + PopupMenuButton( + itemBuilder: (context) => ([ + EditorArchivedMenuOption.copy.popupMenuItem(context), + EditorArchivedMenuOption.share.popupMenuItem(context), + const PopupMenuDivider(), + EditorArchivedMenuOption.unarchive.popupMenuItem(context), + const PopupMenuDivider(), + EditorArchivedMenuOption.about.popupMenuItem(context), + ]), + onSelected: onArchivedMenuOptionSelected, + ), + if (note.status == NoteStatus.deleted) + PopupMenuButton( + itemBuilder: (context) => ([ + EditorDeletedMenuOption.restore.popupMenuItem(context), + EditorDeletedMenuOption.deletePermanently.popupMenuItem(context), + const PopupMenuDivider(), + EditorDeletedMenuOption.about.popupMenuItem(context), + ]), + onSelected: onDeletedMenuOptionSelected, + ), + Gap(Sizes.appBarEnd.size), + ], ); }, ); diff --git a/lib/common/navigation/app_bars/notes/notes_app_bar.dart b/lib/common/navigation/app_bars/notes/notes_app_bar.dart index 5b2a74ca..fb491478 100644 --- a/lib/common/navigation/app_bars/notes/notes_app_bar.dart +++ b/lib/common/navigation/app_bars/notes/notes_app_bar.dart @@ -119,12 +119,11 @@ class NotesAppBar extends ConsumerWidget { viewHintText: context.l.tooltip_search, searchController: SearchController(), viewBackgroundColor: Theme.of(context).colorScheme.surface, - builder: - (context, controller) => IconButton( - onPressed: () => controller.openView(), - icon: const Icon(Icons.search), - tooltip: context.l.tooltip_search, - ), + builder: (context, controller) => IconButton( + onPressed: () => controller.openView(), + icon: const Icon(Icons.search), + tooltip: context.l.tooltip_search, + ), suggestionsBuilder: (context, controller) => searchNotes(controller.text), ); } @@ -146,44 +145,43 @@ class NotesAppBar extends ConsumerWidget { PopupMenuButton( icon: const Icon(Icons.sort), tooltip: context.l.tooltip_sort, - itemBuilder: - (context) => [ - PopupMenuItem( - value: SortMethod.createdDate, - child: ListTile( - selected: sortMethod == SortMethod.createdDate, - leading: const Icon(Symbols.calendar_add_on), - title: Text(context.l.button_sort_creation_date), - ), - ), - PopupMenuItem( - value: SortMethod.editedDate, - child: ListTile( - selected: sortMethod == SortMethod.editedDate, - leading: const Icon(Icons.edit_calendar), - title: Text(context.l.button_sort_edition_date), - ), - ), - PopupMenuItem( - value: SortMethod.title, - child: ListTile( - selected: sortMethod == SortMethod.title, - leading: const Icon(Icons.sort_by_alpha), - title: Text(context.l.button_sort_title), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - value: SortMethod.ascending, - child: ListTile( - title: Text(context.l.button_sort_ascending), - trailing: Checkbox( - value: sortAscending, - onChanged: (ascending) => sort(context, ref, ascending: ascending), - ), - ), + itemBuilder: (context) => [ + PopupMenuItem( + value: SortMethod.createdDate, + child: ListTile( + selected: sortMethod == SortMethod.createdDate, + leading: const Icon(Symbols.calendar_add_on), + title: Text(context.l.button_sort_creation_date), + ), + ), + PopupMenuItem( + value: SortMethod.editedDate, + child: ListTile( + selected: sortMethod == SortMethod.editedDate, + leading: const Icon(Icons.edit_calendar), + title: Text(context.l.button_sort_edition_date), + ), + ), + PopupMenuItem( + value: SortMethod.title, + child: ListTile( + selected: sortMethod == SortMethod.title, + leading: const Icon(Icons.sort_by_alpha), + title: Text(context.l.button_sort_title), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + value: SortMethod.ascending, + child: ListTile( + title: Text(context.l.button_sort_ascending), + trailing: Checkbox( + value: sortAscending, + onChanged: (ascending) => sort(context, ref, ascending: ascending), ), - ], + ), + ), + ], onSelected: (sortMethod) => sort(context, ref, sortMethod: sortMethod), ), ref diff --git a/lib/common/navigation/app_bars/selection/notes_selection_app_bar.dart b/lib/common/navigation/app_bars/selection/notes_selection_app_bar.dart index 6f6abc8e..a41624d7 100644 --- a/lib/common/navigation/app_bars/selection/notes_selection_app_bar.dart +++ b/lib/common/navigation/app_bars/selection/notes_selection_app_bar.dart @@ -109,47 +109,42 @@ class NotesSelectionAppBar extends ConsumerWidget { IconButton( icon: Icon(allSelected ? Icons.deselect : Icons.select_all), tooltip: allSelected ? context.l.tooltip_unselect_all : context.fl.selectAllButtonLabel, - onPressed: - () => - allSelected - ? unselectAllNotes(context, ref, notesStatus: notesStatus) - : selectAllNotes(context, ref, notesStatus: notesStatus), + onPressed: () => allSelected + ? unselectAllNotes(context, ref, notesStatus: notesStatus) + : selectAllNotes(context, ref, notesStatus: notesStatus), ), Padding(padding: Paddings.appBarSeparator, child: Separator.vertical(indent: 16)), if (notesStatus == NoteStatus.available) PopupMenuButton( - itemBuilder: - (context) => ([ - SelectionAvailableMenuOption.copy.popupMenuItem(context), - SelectionAvailableMenuOption.share.popupMenuItem(context), - const PopupMenuDivider(), - SelectionAvailableMenuOption.togglePin.popupMenuItem(context), - if (lockNote) SelectionAvailableMenuOption.toggleLock.popupMenuItem(context), - if (enableLabels) SelectionAvailableMenuOption.addLabels.popupMenuItem(context), - const PopupMenuDivider(), - SelectionAvailableMenuOption.archive.popupMenuItem(context), - SelectionAvailableMenuOption.delete.popupMenuItem(context), - ]), + itemBuilder: (context) => ([ + SelectionAvailableMenuOption.copy.popupMenuItem(context), + SelectionAvailableMenuOption.share.popupMenuItem(context), + const PopupMenuDivider(), + SelectionAvailableMenuOption.togglePin.popupMenuItem(context), + if (lockNote) SelectionAvailableMenuOption.toggleLock.popupMenuItem(context), + if (enableLabels) SelectionAvailableMenuOption.addLabels.popupMenuItem(context), + const PopupMenuDivider(), + SelectionAvailableMenuOption.archive.popupMenuItem(context), + SelectionAvailableMenuOption.delete.popupMenuItem(context), + ]), onSelected: (menuOption) => onAvailableMenuOptionSelected(context, ref, selectedNotes, menuOption), ), if (notesStatus == NoteStatus.archived) PopupMenuButton( - itemBuilder: - (context) => ([ - SelectionArchivedMenuOption.copy.popupMenuItem(context), - SelectionArchivedMenuOption.share.popupMenuItem(context), - const PopupMenuDivider(), - SelectionArchivedMenuOption.unarchive.popupMenuItem(context), - ]), + itemBuilder: (context) => ([ + SelectionArchivedMenuOption.copy.popupMenuItem(context), + SelectionArchivedMenuOption.share.popupMenuItem(context), + const PopupMenuDivider(), + SelectionArchivedMenuOption.unarchive.popupMenuItem(context), + ]), onSelected: (menuOption) => onArchivedMenuOptionSelected(context, ref, selectedNotes, menuOption), ), if (notesStatus == NoteStatus.deleted) PopupMenuButton( - itemBuilder: - (context) => ([ - SelectionDeletedMenuOption.restore.popupMenuItem(context), - SelectionDeletedMenuOption.deletePermanently.popupMenuItem(context), - ]), + itemBuilder: (context) => ([ + SelectionDeletedMenuOption.restore.popupMenuItem(context), + SelectionDeletedMenuOption.deletePermanently.popupMenuItem(context), + ]), onSelected: (menuOption) => onDeletedMenuOptionSelected(context, ref, selectedNotes, menuOption), ), Gap(Sizes.appBarEnd.size), diff --git a/lib/common/navigation/enums/editor/editor_archived_menu_option.dart b/lib/common/navigation/enums/editor/editor_archived_menu_option.dart index 5896bb44..74b754ec 100644 --- a/lib/common/navigation/enums/editor/editor_archived_menu_option.dart +++ b/lib/common/navigation/enums/editor/editor_archived_menu_option.dart @@ -45,6 +45,9 @@ enum EditorArchivedMenuOption { /// /// Uses the alternative icon if [alternative] is set to `true`. PopupMenuItem popupMenuItem(BuildContext context) { - return PopupMenuItem(value: this, child: ListTile(leading: Icon(icon), title: Text(title(context)))); + return PopupMenuItem( + value: this, + child: ListTile(leading: Icon(icon), title: Text(title(context))), + ); } } diff --git a/lib/common/navigation/enums/editor/editor_available_menu_option.dart b/lib/common/navigation/enums/editor/editor_available_menu_option.dart index e96da17f..d7a6eeed 100644 --- a/lib/common/navigation/enums/editor/editor_available_menu_option.dart +++ b/lib/common/navigation/enums/editor/editor_available_menu_option.dart @@ -68,6 +68,9 @@ enum EditorAvailableMenuOption { /// Returns the [PopupMenuItem] widget of the menu option. PopupMenuItem popupMenuItem(BuildContext context) { - return PopupMenuItem(value: this, child: ListTile(leading: Icon(icon), title: Text(title(context)))); + return PopupMenuItem( + value: this, + child: ListTile(leading: Icon(icon), title: Text(title(context))), + ); } } diff --git a/lib/common/navigation/enums/notes/selection_archived_menu_option.dart b/lib/common/navigation/enums/notes/selection_archived_menu_option.dart index 5dfe2ece..8cbe5bfe 100644 --- a/lib/common/navigation/enums/notes/selection_archived_menu_option.dart +++ b/lib/common/navigation/enums/notes/selection_archived_menu_option.dart @@ -37,6 +37,9 @@ enum SelectionArchivedMenuOption { /// /// Uses the alternative icon if [alternative] is set to `true`. PopupMenuItem popupMenuItem(BuildContext context) { - return PopupMenuItem(value: this, child: ListTile(leading: Icon(icon), title: Text(title(context)))); + return PopupMenuItem( + value: this, + child: ListTile(leading: Icon(icon), title: Text(title(context))), + ); } } diff --git a/lib/common/navigation/enums/notes/selection_available_menu_option.dart b/lib/common/navigation/enums/notes/selection_available_menu_option.dart index 67a5a323..ba9bf0b0 100644 --- a/lib/common/navigation/enums/notes/selection_available_menu_option.dart +++ b/lib/common/navigation/enums/notes/selection_available_menu_option.dart @@ -55,6 +55,9 @@ enum SelectionAvailableMenuOption { /// Returns the [PopupMenuItem] widget of the menu option. PopupMenuItem popupMenuItem(BuildContext context) { - return PopupMenuItem(value: this, child: ListTile(leading: Icon(icon), title: Text(title(context)))); + return PopupMenuItem( + value: this, + child: ListTile(leading: Icon(icon), title: Text(title(context))), + ); } } diff --git a/lib/common/navigation/top_navigation.dart b/lib/common/navigation/top_navigation.dart index e38096b6..52f53689 100644 --- a/lib/common/navigation/top_navigation.dart +++ b/lib/common/navigation/top_navigation.dart @@ -23,19 +23,18 @@ class TopNavigation extends StatelessWidget implements PreferredSizeWidget { Widget build(BuildContext context) { return ValueListenableBuilder( valueListenable: isNotesSelectionModeNotifier, - builder: - (context, isNotesSelectionMode, child) => ValueListenableBuilder( - valueListenable: isLabelsSelectionModeNotifier, - builder: (context, isLabelsSelectionMode, child) { - if (isNotesSelectionMode && notesStatus != null) { - return NotesSelectionAppBar(notesStatus: notesStatus!); - } else if (isLabelsSelectionMode) { - return const LabelsSelectionAppBar(); - } + builder: (context, isNotesSelectionMode, child) => ValueListenableBuilder( + valueListenable: isLabelsSelectionModeNotifier, + builder: (context, isLabelsSelectionMode, child) { + if (isNotesSelectionMode && notesStatus != null) { + return NotesSelectionAppBar(notesStatus: notesStatus!); + } else if (isLabelsSelectionMode) { + return const LabelsSelectionAppBar(); + } - return appbar; - }, - ), + return appbar; + }, + ), ); } } diff --git a/lib/common/preferences/enums/swipe_actions/deleted_swipe_action.dart b/lib/common/preferences/enums/swipe_actions/deleted_swipe_action.dart index 4ac6b7fb..a0caf4e9 100644 --- a/lib/common/preferences/enums/swipe_actions/deleted_swipe_action.dart +++ b/lib/common/preferences/enums/swipe_actions/deleted_swipe_action.dart @@ -86,10 +86,9 @@ enum DeletedSwipeAction { Widget iconWidget(BuildContext context) { return Icon( icon, - color: - dangerous - ? Theme.of(context).colorScheme.onErrorContainer - : Theme.of(context).colorScheme.onTertiaryContainer, + color: dangerous + ? Theme.of(context).colorScheme.onErrorContainer + : Theme.of(context).colorScheme.onTertiaryContainer, ); } @@ -98,10 +97,9 @@ enum DeletedSwipeAction { return Text( title(context), style: Theme.of(context).textTheme.titleMedium?.copyWith( - color: - dangerous - ? Theme.of(context).colorScheme.onErrorContainer - : Theme.of(context).colorScheme.onTertiaryContainer, + color: dangerous + ? Theme.of(context).colorScheme.onErrorContainer + : Theme.of(context).colorScheme.onTertiaryContainer, ), ); } diff --git a/lib/common/ui/snack_bar_utils.dart b/lib/common/ui/snack_bar_utils.dart index 01541980..fcc22831 100644 --- a/lib/common/ui/snack_bar_utils.dart +++ b/lib/common/ui/snack_bar_utils.dart @@ -30,10 +30,9 @@ class SnackBarUtils { SnackBar( behavior: behavior, content: Text(text), - action: - onCancel != null - ? SnackBarAction(label: context.fl.cancelButtonLabel, onPressed: () => onCancel(globalRef)) - : null, + action: onCancel != null + ? SnackBarAction(label: context.fl.cancelButtonLabel, onPressed: () => onCancel(globalRef)) + : null, ), ); } diff --git a/lib/common/ui/theme_utils.dart b/lib/common/ui/theme_utils.dart index ddbce47b..4f0df27c 100644 --- a/lib/common/ui/theme_utils.dart +++ b/lib/common/ui/theme_utils.dart @@ -98,36 +98,35 @@ class ThemeUtils { seedColor: darkDynamicColorScheme.primary, ); - colorScheme = - blackTheming - ? darkDynamicColorScheme.copyWith( - // TODO: remove when dynamic_colors is updated to support new roles - // See https://github.com/material-foundation/flutter-packages/issues/582 - // ignore: deprecated_member_use - background: Colors.black, - surface: Colors.black, - surfaceContainerLowest: temporaryColorScheme.surfaceContainerLowest, - surfaceContainerLow: temporaryColorScheme.surfaceContainerLow, - surfaceContainer: temporaryColorScheme.surfaceContainer, - surfaceContainerHigh: temporaryColorScheme.surfaceContainerHigh, - surfaceContainerHighest: temporaryColorScheme.surfaceContainerHighest, - ) - : darkDynamicColorScheme.copyWith( - surfaceContainerLowest: temporaryColorScheme.surfaceContainerLowest, - surfaceContainerLow: temporaryColorScheme.surfaceContainerLow, - surfaceContainer: temporaryColorScheme.surfaceContainer, - surfaceContainerHigh: temporaryColorScheme.surfaceContainerHigh, - surfaceContainerHighest: temporaryColorScheme.surfaceContainerHighest, - ); + colorScheme = blackTheming + ? darkDynamicColorScheme.copyWith( + // TODO: remove when dynamic_colors is updated to support new roles + // See https://github.com/material-foundation/flutter-packages/issues/582 + // ignore: deprecated_member_use + background: Colors.black, + surface: Colors.black, + surfaceContainerLowest: temporaryColorScheme.surfaceContainerLowest, + surfaceContainerLow: temporaryColorScheme.surfaceContainerLow, + surfaceContainer: temporaryColorScheme.surfaceContainer, + surfaceContainerHigh: temporaryColorScheme.surfaceContainerHigh, + surfaceContainerHighest: temporaryColorScheme.surfaceContainerHighest, + ) + : darkDynamicColorScheme.copyWith( + surfaceContainerLowest: temporaryColorScheme.surfaceContainerLowest, + surfaceContainerLow: temporaryColorScheme.surfaceContainerLow, + surfaceContainer: temporaryColorScheme.surfaceContainer, + surfaceContainerHigh: temporaryColorScheme.surfaceContainerHigh, + surfaceContainerHighest: temporaryColorScheme.surfaceContainerHighest, + ); } else { - colorScheme = - blackTheming - ? ColorScheme.fromSeed(brightness: Brightness.dark, seedColor: customPrimaryColor, surface: Colors.black) - : ColorScheme.fromSeed(brightness: Brightness.dark, seedColor: customPrimaryColor); + colorScheme = blackTheming + ? ColorScheme.fromSeed(brightness: Brightness.dark, seedColor: customPrimaryColor, surface: Colors.black) + : ColorScheme.fromSeed(brightness: Brightness.dark, seedColor: customPrimaryColor); } - final textTheme = - whiteTextDarkMode ? Typography().white.apply(bodyColor: Colors.white, displayColor: Colors.white) : null; + final textTheme = whiteTextDarkMode + ? Typography().white.apply(bodyColor: Colors.white, displayColor: Colors.white) + : null; return ThemeData( useMaterial3: true, diff --git a/lib/common/widgets/notes/note_tile.dart b/lib/common/widgets/notes/note_tile.dart index d25adba5..ea14d1bb 100644 --- a/lib/common/widgets/notes/note_tile.dart +++ b/lib/common/widgets/notes/note_tile.dart @@ -258,39 +258,38 @@ class _NoteTileState extends ConsumerState { if (!widget.note.isTitleEmpty) widget.search != null ? SubstringHighlight( - text: widget.note.title, - terms: widget.search?.split(' '), - maxLines: 1, - overflow: TextOverflow.ellipsis, - textStyle: titleStyle, - textStyleHighlight: titleStyleHighlighted, - ) + text: widget.note.title, + terms: widget.search?.split(' '), + maxLines: 1, + overflow: TextOverflow.ellipsis, + textStyle: titleStyle, + textStyleHighlight: titleStyleHighlighted, + ) : Text( - widget.note.title, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: - biggerTitles - ? Theme.of(context).textTheme.titleLarge - : Theme.of(context).textTheme.titleMedium, - ), + widget.note.title, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: biggerTitles + ? Theme.of(context).textTheme.titleLarge + : Theme.of(context).textTheme.titleMedium, + ), // Subtitle if (showContent) widget.search != null ? SubstringHighlight( - text: widget.note.contentPreview, - terms: widget.search?.split(' '), - maxLines: maximumContentPreviewLines, - overflow: TextOverflow.ellipsis, - textStyle: contentStyle, - textStyleHighlight: contentStyleHighlighted, - ) + text: widget.note.contentPreview, + terms: widget.search?.split(' '), + maxLines: maximumContentPreviewLines, + overflow: TextOverflow.ellipsis, + textStyle: contentStyle, + textStyleHighlight: contentStyleHighlighted, + ) : Text( - widget.note.contentPreview, - maxLines: maximumContentPreviewLines, - overflow: TextOverflow.ellipsis, - style: contentStyle, - ), + widget.note.contentPreview, + maxLines: maximumContentPreviewLines, + overflow: TextOverflow.ellipsis, + style: contentStyle, + ), if (enableLabels && showLabelsListOnNoteTile) ...[ Gap(4), @@ -380,9 +379,8 @@ class _NoteTileState extends ConsumerState { ); } - confirmDismiss = - (DismissDirection direction) => - onAvailableDismissed(direction, availableSwipeActions.right, availableSwipeActions.left); + confirmDismiss = (DismissDirection direction) => + onAvailableDismissed(direction, availableSwipeActions.right, availableSwipeActions.left); // Build the archived dismissible widgets case NoteStatus.archived: @@ -408,9 +406,8 @@ class _NoteTileState extends ConsumerState { ); } - confirmDismiss = - (DismissDirection direction) => - onArchivedDismissed(direction, archivedSwipeActions.right, archivedSwipeActions.left); + confirmDismiss = (DismissDirection direction) => + onArchivedDismissed(direction, archivedSwipeActions.right, archivedSwipeActions.left); // Build the deleted dismissible widgets case NoteStatus.deleted: diff --git a/lib/common/widgets/notes/notes_list.dart b/lib/common/widgets/notes/notes_list.dart index 56c6cbcc..37ed6d57 100644 --- a/lib/common/widgets/notes/notes_list.dart +++ b/lib/common/widgets/notes/notes_list.dart @@ -53,26 +53,26 @@ class NotesList extends ConsumerWidget { return layout == Layout.list ? ListView.separated( - padding: showTilesBackground ? Paddings.notesWithBackground : Paddings.fab, - itemCount: notes.length, - itemBuilder: (context, index) { - return NoteTile(note: notes[index]); - }, - separatorBuilder: (BuildContext context, int index) { - return Padding( - padding: showTilesBackground ? Paddings.notesListWithBackgroundSeparation : EdgeInsetsDirectional.zero, - child: showSeparators ? Separator.horizontal(indent: 8) : null, - ); - }, - ) + padding: showTilesBackground ? Paddings.notesWithBackground : Paddings.fab, + itemCount: notes.length, + itemBuilder: (context, index) { + return NoteTile(note: notes[index]); + }, + separatorBuilder: (BuildContext context, int index) { + return Padding( + padding: showTilesBackground ? Paddings.notesListWithBackgroundSeparation : EdgeInsetsDirectional.zero, + child: showSeparators ? Separator.horizontal(indent: 8) : null, + ); + }, + ) : AlignedGridView.count( - padding: Paddings.notesWithBackground, - mainAxisSpacing: Sizes.notesGridLayoutSpacing.size, - crossAxisSpacing: Sizes.notesGridLayoutSpacing.size, - crossAxisCount: crossAxisCount, - itemCount: notes.length, - itemBuilder: (context, index) => NoteTile(note: notes[index]), - ); + padding: Paddings.notesWithBackground, + mainAxisSpacing: Sizes.notesGridLayoutSpacing.size, + crossAxisSpacing: Sizes.notesGridLayoutSpacing.size, + crossAxisCount: crossAxisCount, + itemCount: notes.length, + itemBuilder: (context, index) => NoteTile(note: notes[index]), + ); } @override diff --git a/lib/common/widgets/placeholders/loading_placeholder.dart b/lib/common/widgets/placeholders/loading_placeholder.dart index e40c51ea..8be41b6e 100644 --- a/lib/common/widgets/placeholders/loading_placeholder.dart +++ b/lib/common/widgets/placeholders/loading_placeholder.dart @@ -10,7 +10,10 @@ class LoadingPlaceholder extends StatelessWidget { @override Widget build(BuildContext context) { return Center( - child: Padding(padding: Paddings.page, child: const SingleChildScrollView(child: CircularProgressIndicator())), + child: Padding( + padding: Paddings.page, + child: const SingleChildScrollView(child: CircularProgressIndicator()), + ), ); } } diff --git a/lib/models/note/types/markdown_note.dart b/lib/models/note/types/markdown_note.dart index 545c83ea..47b779f7 100644 --- a/lib/models/note/types/markdown_note.dart +++ b/lib/models/note/types/markdown_note.dart @@ -48,19 +48,17 @@ class MarkdownNote extends Note { factory MarkdownNote.fromJson(Map json) => _$MarkdownNoteFromJson(json); /// Plain text note from [json] data, encrypted with [password]. - factory MarkdownNote.fromJsonEncrypted(Map json, String password) => - _$MarkdownNoteFromJson(json) - ..title = (json['title'] as String).isEmpty ? '' : EncryptionUtils().decrypt(password, json['title'] as String) - ..content = EncryptionUtils().decrypt(password, json['content'] as String); + factory MarkdownNote.fromJsonEncrypted(Map json, String password) => _$MarkdownNoteFromJson(json) + ..title = (json['title'] as String).isEmpty ? '' : EncryptionUtils().decrypt(password, json['title'] as String) + ..content = EncryptionUtils().decrypt(password, json['content'] as String); /// Plain text note to JSON. Map toJson() => _$MarkdownNoteToJson(this); @override - Note encrypted(String password) => - this - ..title = isTitleEmpty ? '' : EncryptionUtils().encrypt(password, title) - ..content = EncryptionUtils().encrypt(password, content); + Note encrypted(String password) => this + ..title = isTitleEmpty ? '' : EncryptionUtils().encrypt(password, title) + ..content = EncryptionUtils().encrypt(password, content); @ignore @override diff --git a/lib/models/note/types/plain_text_note.dart b/lib/models/note/types/plain_text_note.dart index d031f097..9828a1eb 100644 --- a/lib/models/note/types/plain_text_note.dart +++ b/lib/models/note/types/plain_text_note.dart @@ -48,19 +48,17 @@ class PlainTextNote extends Note { factory PlainTextNote.fromJson(Map json) => _$PlainTextNoteFromJson(json); /// Plain text note from [json] data, encrypted with [password]. - factory PlainTextNote.fromJsonEncrypted(Map json, String password) => - _$PlainTextNoteFromJson(json) - ..title = (json['title'] as String).isEmpty ? '' : EncryptionUtils().decrypt(password, json['title'] as String) - ..content = EncryptionUtils().decrypt(password, json['content'] as String); + factory PlainTextNote.fromJsonEncrypted(Map json, String password) => _$PlainTextNoteFromJson(json) + ..title = (json['title'] as String).isEmpty ? '' : EncryptionUtils().decrypt(password, json['title'] as String) + ..content = EncryptionUtils().decrypt(password, json['content'] as String); /// Plain text note to JSON. Map toJson() => _$PlainTextNoteToJson(this); @override - Note encrypted(String password) => - this - ..title = isTitleEmpty ? '' : EncryptionUtils().encrypt(password, title) - ..content = EncryptionUtils().encrypt(password, content); + Note encrypted(String password) => this + ..title = isTitleEmpty ? '' : EncryptionUtils().encrypt(password, title) + ..content = EncryptionUtils().encrypt(password, content); @ignore @override diff --git a/lib/models/note/types/rich_text_note.dart b/lib/models/note/types/rich_text_note.dart index 2e218a50..c5775f5d 100644 --- a/lib/models/note/types/rich_text_note.dart +++ b/lib/models/note/types/rich_text_note.dart @@ -51,19 +51,17 @@ class RichTextNote extends Note { factory RichTextNote.fromJson(Map json) => _$RichTextNoteFromJson(json); /// Rich text note from [json] data, encrypted with [password]. - factory RichTextNote.fromJsonEncrypted(Map json, String password) => - _$RichTextNoteFromJson(json) - ..title = (json['title'] as String).isEmpty ? '' : EncryptionUtils().decrypt(password, json['title'] as String) - ..content = EncryptionUtils().decrypt(password, json['content'] as String); + factory RichTextNote.fromJsonEncrypted(Map json, String password) => _$RichTextNoteFromJson(json) + ..title = (json['title'] as String).isEmpty ? '' : EncryptionUtils().decrypt(password, json['title'] as String) + ..content = EncryptionUtils().decrypt(password, json['content'] as String); /// Rich text note to JSON. Map toJson() => _$RichTextNoteToJson(this); @override - Note encrypted(String password) => - this - ..title = isTitleEmpty ? '' : EncryptionUtils().encrypt(password, title) - ..content = EncryptionUtils().encrypt(password, content); + Note encrypted(String password) => this + ..title = isTitleEmpty ? '' : EncryptionUtils().encrypt(password, title) + ..content = EncryptionUtils().encrypt(password, content); /// Document containing the fleather content representation. @ignore diff --git a/lib/pages/archives/archives_page.dart b/lib/pages/archives/archives_page.dart index 0a40e149..1ae6f166 100644 --- a/lib/pages/archives/archives_page.dart +++ b/lib/pages/archives/archives_page.dart @@ -20,7 +20,10 @@ class _ArchivesPageState extends ConsumerState { @override Widget build(BuildContext context) { return Scaffold( - appBar: TopNavigation(appbar: NotesAppBar(notesStatus: NoteStatus.archived), notesStatus: NoteStatus.archived), + appBar: TopNavigation( + appbar: NotesAppBar(notesStatus: NoteStatus.archived), + notesStatus: NoteStatus.archived, + ), drawer: SideNavigation(), body: NotesList(notesStatus: NoteStatus.archived), ); diff --git a/lib/pages/bin/bin_page.dart b/lib/pages/bin/bin_page.dart index 682ecbb2..a066be63 100644 --- a/lib/pages/bin/bin_page.dart +++ b/lib/pages/bin/bin_page.dart @@ -21,7 +21,10 @@ class _BinPageState extends ConsumerState { @override Widget build(BuildContext context) { return Scaffold( - appBar: TopNavigation(appbar: NotesAppBar(notesStatus: NoteStatus.deleted), notesStatus: NoteStatus.deleted), + appBar: TopNavigation( + appbar: NotesAppBar(notesStatus: NoteStatus.deleted), + notesStatus: NoteStatus.deleted, + ), drawer: SideNavigation(), floatingActionButton: EmptyBinFab(), body: NotesList(notesStatus: NoteStatus.deleted), diff --git a/lib/pages/bin/widgets/empty_bin_fab.dart b/lib/pages/bin/widgets/empty_bin_fab.dart index f746cf94..730e53f5 100644 --- a/lib/pages/bin/widgets/empty_bin_fab.dart +++ b/lib/pages/bin/widgets/empty_bin_fab.dart @@ -18,10 +18,10 @@ class EmptyBinFab extends ConsumerWidget { return deletedNotesCount != null && deletedNotesCount != 0 ? FloatingActionButton( - tooltip: context.l.tooltip_fab_empty_bin, - onPressed: () => emptyBin(context, ref), - child: const Icon(Icons.delete_forever), - ) + tooltip: context.l.tooltip_fab_empty_bin, + onPressed: () => emptyBin(context, ref), + child: const Icon(Icons.delete_forever), + ) : EmptyPlaceholder(); } } diff --git a/lib/pages/editor/dialogs/labels_selection_dialog.dart b/lib/pages/editor/dialogs/labels_selection_dialog.dart index 3109a409..3b2f5315 100644 --- a/lib/pages/editor/dialogs/labels_selection_dialog.dart +++ b/lib/pages/editor/dialogs/labels_selection_dialog.dart @@ -72,31 +72,30 @@ class _LabelsSelectionDialogState extends ConsumerState { title: Text(widget.note == null ? context.l.dialog_select_labels_to_add : context.l.dialog_select_labels), content: SingleChildScrollView( child: ListBody( - children: - labels.mapIndexed((index, label) { - return CheckboxListTile( - value: label.selected, - secondary: VariedIcon.varied( - label.pinned ? Icons.label_important : Icons.label, - fill: 1.0, - color: label.color, + children: labels.mapIndexed((index, label) { + return CheckboxListTile( + value: label.selected, + secondary: VariedIcon.varied( + label.pinned ? Icons.label_important : Icons.label, + fill: 1.0, + color: label.color, + ), + title: Row( + children: [ + Expanded( + child: Text( + label.name, + style: bodyLarge?.copyWith(color: !label.visible ? bodyLarge.color?.subdued : null), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), ), - title: Row( - children: [ - Expanded( - child: Text( - label.name, - style: bodyLarge?.copyWith(color: !label.visible ? bodyLarge.color?.subdued : null), - maxLines: 2, - overflow: TextOverflow.ellipsis, - ), - ), - if (lockLabel && label.locked) Icon(Icons.lock, size: Sizes.iconSmall.size), - ], - ), - onChanged: (value) => onChanged(index, value), - ); - }).toList(), + if (lockLabel && label.locked) Icon(Icons.lock, size: Sizes.iconSmall.size), + ], + ), + onChanged: (value) => onChanged(index, value), + ); + }).toList(), ), ), actions: [ diff --git a/lib/pages/editor/editor_page.dart b/lib/pages/editor/editor_page.dart index efb4fa6b..6d018edf 100644 --- a/lib/pages/editor/editor_page.dart +++ b/lib/pages/editor/editor_page.dart @@ -151,11 +151,11 @@ class _EditorState extends ConsumerState { builder: (context, locked, child) { return locked ? LockPage( - back: false, - lockNotifier: lockNoteNotifier, - description: context.l.lock_page_description_note, - reason: context.l.lock_page_reason_note, - ) + back: false, + lockNotifier: lockNoteNotifier, + description: context.l.lock_page_description_note, + reason: context.l.lock_page_reason_note, + ) : editor; }, ); diff --git a/lib/pages/editor/widgets/editors/checklist_editor.dart b/lib/pages/editor/widgets/editors/checklist_editor.dart index 0d9e1d35..20014207 100644 --- a/lib/pages/editor/widgets/editors/checklist_editor.dart +++ b/lib/pages/editor/widgets/editors/checklist_editor.dart @@ -23,10 +23,9 @@ class ChecklistEditor extends ConsumerWidget { /// Called when an item of the checklist changes with the new [checklistLines]. void onChecklistChanged(WidgetRef ref, List checklistLines) { - ChecklistNote newNote = - note - ..checkboxes = checklistLines.map((checklistLine) => checklistLine.toggled).toList() - ..texts = checklistLines.map((checklistLine) => checklistLine.text).toList(); + ChecklistNote newNote = note + ..checkboxes = checklistLines.map((checklistLine) => checklistLine.toggled).toList() + ..texts = checklistLines.map((checklistLine) => checklistLine.text).toList(); ref.read(notesProvider(status: NoteStatus.available, label: currentLabelFilter).notifier).edit(newNote); } diff --git a/lib/pages/editor/widgets/editors/markdown_editor.dart b/lib/pages/editor/widgets/editors/markdown_editor.dart index 2f3d9a69..94869376 100644 --- a/lib/pages/editor/widgets/editors/markdown_editor.dart +++ b/lib/pages/editor/widgets/editors/markdown_editor.dart @@ -49,10 +49,6 @@ class _MarkdownEditorState extends ConsumerState { contentTextController = TextEditingController(text: widget.note.content); } - void onFocusChange(bool hasFocus) { - editorHasFocusNotifier.value = hasFocus; - } - void onChanged(String content) { MarkdownNote note = widget.note..content = content; @@ -65,38 +61,34 @@ class _MarkdownEditorState extends ConsumerState { return Padding( padding: Paddings.pageHorizontal, - child: - widget.readOnly && !widget.note.isContentEmpty - ? Markdown( - data: widget.note.content, - padding: EdgeInsets.zero, - selectable: true, - extensionSet: ExtensionSet.gitHubFlavored, - styleSheet: MarkdownStyleSheet.fromTheme(theme).copyWith( - blockquoteDecoration: BoxDecoration( - color: theme.colorScheme.surfaceContainerHighest, - borderRadius: BorderRadius.circular(2.0), - ), - codeblockDecoration: BoxDecoration( - color: theme.colorScheme.surfaceContainerHighest, - borderRadius: BorderRadius.circular(2.0), - ), + child: widget.readOnly && !widget.note.isContentEmpty + ? Markdown( + data: widget.note.content, + padding: EdgeInsets.zero, + selectable: true, + extensionSet: ExtensionSet.gitHubFlavored, + styleSheet: MarkdownStyleSheet.fromTheme(theme).copyWith( + blockquoteDecoration: BoxDecoration( + color: theme.colorScheme.surfaceContainerHighest, + borderRadius: BorderRadius.circular(2.0), ), - ) - : Focus( - onFocusChange: onFocusChange, - child: TextField( - controller: contentTextController, - focusNode: editorFocusNode, - readOnly: widget.readOnly && widget.note.isContentEmpty, - autofocus: widget.autofocus, - maxLines: null, - expands: true, - decoration: InputDecoration.collapsed(hintText: context.l.hint_content), - spellCheckConfiguration: SpellCheckConfiguration(spellCheckService: DefaultSpellCheckService()), - onChanged: onChanged, + codeblockDecoration: BoxDecoration( + color: theme.colorScheme.surfaceContainerHighest, + borderRadius: BorderRadius.circular(2.0), ), ), + ) + : TextField( + controller: contentTextController, + focusNode: editorFocusNode, + readOnly: widget.readOnly && widget.note.isContentEmpty, + autofocus: widget.autofocus, + maxLines: null, + expands: true, + decoration: InputDecoration.collapsed(hintText: context.l.hint_content), + spellCheckConfiguration: SpellCheckConfiguration(spellCheckService: DefaultSpellCheckService()), + onChanged: onChanged, + ), ); } } diff --git a/lib/pages/editor/widgets/editors/plain_text_editor.dart b/lib/pages/editor/widgets/editors/plain_text_editor.dart index f7a3f8c5..cd144fef 100644 --- a/lib/pages/editor/widgets/editors/plain_text_editor.dart +++ b/lib/pages/editor/widgets/editors/plain_text_editor.dart @@ -47,10 +47,6 @@ class _PlainTextEditorState extends ConsumerState { contentTextController = TextEditingController(text: widget.note.content); } - void onFocusChange(bool hasFocus) { - editorHasFocusNotifier.value = hasFocus; - } - void onChanged(String content) { PlainTextNote note = widget.note..content = content; @@ -61,19 +57,16 @@ class _PlainTextEditorState extends ConsumerState { Widget build(BuildContext context) { return Padding( padding: Paddings.pageHorizontal, - child: Focus( - onFocusChange: onFocusChange, - child: TextField( - controller: contentTextController, - focusNode: editorFocusNode, - readOnly: widget.readOnly, - autofocus: widget.autofocus, - maxLines: null, - expands: true, - decoration: InputDecoration.collapsed(hintText: context.l.hint_content), - spellCheckConfiguration: SpellCheckConfiguration(spellCheckService: DefaultSpellCheckService()), - onChanged: onChanged, - ), + child: TextField( + controller: contentTextController, + focusNode: editorFocusNode, + readOnly: widget.readOnly, + autofocus: widget.autofocus, + maxLines: null, + expands: true, + decoration: InputDecoration.collapsed(hintText: context.l.hint_content), + spellCheckConfiguration: SpellCheckConfiguration(spellCheckService: DefaultSpellCheckService()), + onChanged: onChanged, ), ); } diff --git a/lib/pages/editor/widgets/editors/rich_text_editor.dart b/lib/pages/editor/widgets/editors/rich_text_editor.dart index 5eeffe2b..976669d7 100644 --- a/lib/pages/editor/widgets/editors/rich_text_editor.dart +++ b/lib/pages/editor/widgets/editors/rich_text_editor.dart @@ -58,10 +58,6 @@ class _RichTextEditorState extends ConsumerState { } } - void onFocusChange(bool hasFocus) { - editorHasFocusNotifier.value = hasFocus; - } - void onLaunchUrl(String? url) { if (url == null) { return; @@ -101,13 +97,9 @@ class _RichTextEditorState extends ConsumerState { builder: (context) { final fleatherThemeFallback = FleatherThemeData.fallback(context); final fleatherTheme = fleatherThemeFallback.copyWith( - paragraph: - !useParagraphsSpacing - ? TextBlockTheme( - style: fleatherThemeFallback.paragraph.style, - spacing: const VerticalSpacing.zero(), - ) - : null, + paragraph: !useParagraphsSpacing + ? TextBlockTheme(style: fleatherThemeFallback.paragraph.style, spacing: const VerticalSpacing.zero()) + : null, link: fleatherThemeFallback.link.copyWith(color: Theme.of(context).colorScheme.primary), ); diff --git a/lib/pages/editor/widgets/toolbar/color_toolbar_button.dart b/lib/pages/editor/widgets/toolbar/color_toolbar_button.dart index 3026b024..00f6de50 100644 --- a/lib/pages/editor/widgets/toolbar/color_toolbar_button.dart +++ b/lib/pages/editor/widgets/toolbar/color_toolbar_button.dart @@ -96,8 +96,9 @@ class _ColorToolbarButtonState extends State { /// Sets the new color. void setColor() { - final attribute = - pickedColor != null ? widget.attributeKey.withColor(pickedColor!.toARGB32()) : widget.attributeKey.unset; + final attribute = pickedColor != null + ? widget.attributeKey.withColor(pickedColor!.toARGB32()) + : widget.attributeKey.unset; widget.fleatherController.formatSelection(attribute); } diff --git a/lib/pages/editor/widgets/toolbar/toolbar.dart b/lib/pages/editor/widgets/toolbar/toolbar.dart index 2db31582..82d26690 100644 --- a/lib/pages/editor/widgets/toolbar/toolbar.dart +++ b/lib/pages/editor/widgets/toolbar/toolbar.dart @@ -41,10 +41,9 @@ class _ToolbarState extends State with SingleTickerProviderStateMixin { super.initState(); isFirstRow = true; - controller = - AnimationController(vsync: this, duration: const Duration(seconds: 2)) - ..forward() - ..repeat(reverse: true); + controller = AnimationController(vsync: this, duration: const Duration(seconds: 2)) + ..forward() + ..repeat(reverse: true); animation = Tween(begin: 0.0, end: 1.0).animate(controller); } @@ -89,7 +88,10 @@ class _ToolbarState extends State with SingleTickerProviderStateMixin { return Material( key: UniqueKey(), color: Theme.of(context).colorScheme.secondaryContainer, - child: InkWell(onTap: toggleToolbarRows, child: SizedBox(height: 48, width: 48, child: Icon(icon))), + child: InkWell( + onTap: toggleToolbarRows, + child: SizedBox(height: 48, width: 48, child: Icon(icon)), + ), ); } @@ -334,8 +336,9 @@ class _ToolbarState extends State with SingleTickerProviderStateMixin { }; Widget toolbar = switch (toolbarStyle) { - ToolbarStyle.oneRowSimple || - ToolbarStyle.oneRowAll => Center(child: FleatherToolbar(padding: EdgeInsets.zero, children: firstRow)), + ToolbarStyle.oneRowSimple || ToolbarStyle.oneRowAll => Center( + child: FleatherToolbar(padding: EdgeInsets.zero, children: firstRow), + ), ToolbarStyle.twoRowsStacked => FleatherToolbar( padding: EdgeInsets.zero, children: [ @@ -373,10 +376,9 @@ class _ToolbarState extends State with SingleTickerProviderStateMixin { duration: const Duration(milliseconds: 250), switchInCurve: Curves.easeInOut, switchOutCurve: Curves.easeInOut, - child: - isFirstRow - ? getToolbarRowsToggleButton(Icons.arrow_downward) - : getToolbarRowsToggleButton(Icons.arrow_upward), + child: isFirstRow + ? getToolbarRowsToggleButton(Icons.arrow_downward) + : getToolbarRowsToggleButton(Icons.arrow_upward), ), ], ), diff --git a/lib/pages/labels/dialogs/label_dialog.dart b/lib/pages/labels/dialogs/label_dialog.dart index a30a1277..0f11bc3c 100644 --- a/lib/pages/labels/dialogs/label_dialog.dart +++ b/lib/pages/labels/dialogs/label_dialog.dart @@ -113,12 +113,11 @@ class _AddLabelDialogState extends ConsumerState { return; } - final label = - widget.label != null - ? (widget.label! - ..name = nameController.text - ..colorHex = color.toARGB32()) - : Label(name: nameController.text, colorHex: color.toARGB32()); + final label = widget.label != null + ? (widget.label! + ..name = nameController.text + ..colorHex = color.toARGB32()) + : Label(name: nameController.text, colorHex: color.toARGB32()); Navigator.pop(context, label); } diff --git a/lib/pages/labels/enums/label_tile_menu_option.dart b/lib/pages/labels/enums/label_tile_menu_option.dart index 3899da7d..608ad75a 100644 --- a/lib/pages/labels/enums/label_tile_menu_option.dart +++ b/lib/pages/labels/enums/label_tile_menu_option.dart @@ -71,10 +71,9 @@ enum LabelTileMenuOption { leading: Icon(icon, color: dangerous ? Theme.of(context).colorScheme.error : null), title: Text( title(context), - style: - dangerous - ? Theme.of(context).textTheme.titleSmall?.copyWith(color: Theme.of(context).colorScheme.error) - : null, + style: dangerous + ? Theme.of(context).textTheme.titleSmall?.copyWith(color: Theme.of(context).colorScheme.error) + : null, ), ), ); diff --git a/lib/pages/labels/labels_page.dart b/lib/pages/labels/labels_page.dart index 1f8056a8..adf9c334 100644 --- a/lib/pages/labels/labels_page.dart +++ b/lib/pages/labels/labels_page.dart @@ -46,16 +46,15 @@ class LabelsPage extends ConsumerWidget { }, ), Expanded( - child: - labels.isEmpty - ? EmptyPlaceholder.labels(context) - : ListView.builder( - padding: Paddings.fab, - itemCount: labels.length, - itemBuilder: (BuildContext context, int index) { - return LabelTile(label: labels[index]); - }, - ), + child: labels.isEmpty + ? EmptyPlaceholder.labels(context) + : ListView.builder( + padding: Paddings.fab, + itemCount: labels.length, + itemBuilder: (BuildContext context, int index) { + return LabelTile(label: labels[index]); + }, + ), ), ], ), diff --git a/lib/pages/notes/widgets/add_note_fab.dart b/lib/pages/notes/widgets/add_note_fab.dart index 52516a63..9955e56b 100644 --- a/lib/pages/notes/widgets/add_note_fab.dart +++ b/lib/pages/notes/widgets/add_note_fab.dart @@ -43,59 +43,59 @@ class _AddNoteFabState extends ConsumerState { return availableNotesTypes.length == 1 ? FloatingActionButton( - tooltip: context.l.tooltip_fab_add_note, - onPressed: () => onPressed(availableNotesTypes.first), - child: const Icon(Icons.add), - ) - : ExpandableFab( - key: widget.label == null ? addNoteFabKey : labeledAddNoteFabKey, - type: ExpandableFabType.up, - childrenAnimation: ExpandableFabAnimation.none, - distance: 64, - openButtonBuilder: RotateFloatingActionButtonBuilder( - heroTag: '', + tooltip: context.l.tooltip_fab_add_note, + onPressed: () => onPressed(availableNotesTypes.first), child: const Icon(Icons.add), - ), - closeButtonBuilder: RotateFloatingActionButtonBuilder( - heroTag: '', - child: const Icon(Icons.close), - ), - afterOpen: onOpen, - afterClose: onClose, - children: [ - if (availableNotesTypes.contains(NoteType.plainText)) - FloatingActionButton.extended( - heroTag: '', - tooltip: context.l.tooltip_fab_add_plain_text_note, - onPressed: () => onPressed(NoteType.plainText), - icon: Icon(NoteType.plainText.icon), - label: Text(NoteType.plainText.title(context)), - ), - if (availableNotesTypes.contains(NoteType.markdown)) - FloatingActionButton.extended( - heroTag: '', - tooltip: context.l.tooltip_fab_add_markdown_note, - onPressed: () => onPressed(NoteType.markdown), - icon: Icon(NoteType.markdown.icon), - label: Text(NoteType.markdown.title(context)), - ), - if (availableNotesTypes.contains(NoteType.richText)) - FloatingActionButton.extended( - heroTag: '', - tooltip: context.l.tooltip_fab_add_rich_text_note, - onPressed: () => onPressed(NoteType.richText), - icon: Icon(NoteType.richText.icon), - label: Text(NoteType.richText.title(context)), - ), - if (availableNotesTypes.contains(NoteType.checklist)) - FloatingActionButton.extended( - heroTag: '', - tooltip: context.l.tooltip_fab_add_checklist_note, - onPressed: () => onPressed(NoteType.checklist), - icon: Icon(NoteType.checklist.icon), - label: Text(NoteType.checklist.title(context)), - ), - ], - ); + ) + : ExpandableFab( + key: widget.label == null ? addNoteFabKey : labeledAddNoteFabKey, + type: ExpandableFabType.up, + childrenAnimation: ExpandableFabAnimation.none, + distance: 64, + openButtonBuilder: RotateFloatingActionButtonBuilder( + heroTag: '', + child: const Icon(Icons.add), + ), + closeButtonBuilder: RotateFloatingActionButtonBuilder( + heroTag: '', + child: const Icon(Icons.close), + ), + afterOpen: onOpen, + afterClose: onClose, + children: [ + if (availableNotesTypes.contains(NoteType.plainText)) + FloatingActionButton.extended( + heroTag: '', + tooltip: context.l.tooltip_fab_add_plain_text_note, + onPressed: () => onPressed(NoteType.plainText), + icon: Icon(NoteType.plainText.icon), + label: Text(NoteType.plainText.title(context)), + ), + if (availableNotesTypes.contains(NoteType.markdown)) + FloatingActionButton.extended( + heroTag: '', + tooltip: context.l.tooltip_fab_add_markdown_note, + onPressed: () => onPressed(NoteType.markdown), + icon: Icon(NoteType.markdown.icon), + label: Text(NoteType.markdown.title(context)), + ), + if (availableNotesTypes.contains(NoteType.richText)) + FloatingActionButton.extended( + heroTag: '', + tooltip: context.l.tooltip_fab_add_rich_text_note, + onPressed: () => onPressed(NoteType.richText), + icon: Icon(NoteType.richText.icon), + label: Text(NoteType.richText.title(context)), + ), + if (availableNotesTypes.contains(NoteType.checklist)) + FloatingActionButton.extended( + heroTag: '', + tooltip: context.l.tooltip_fab_add_checklist_note, + onPressed: () => onPressed(NoteType.checklist), + icon: Icon(NoteType.checklist.icon), + label: Text(NoteType.checklist.title(context)), + ), + ], + ); } } diff --git a/lib/pages/settings/pages/settings_accessibility_page.dart b/lib/pages/settings/pages/settings_accessibility_page.dart index 46aecf9d..99d9044b 100644 --- a/lib/pages/settings/pages/settings_accessibility_page.dart +++ b/lib/pages/settings/pages/settings_accessibility_page.dart @@ -90,9 +90,8 @@ class _SettingsAppearancePageState extends ConsumerState - (textScaling as num).formatAsPercentage(locale: SystemUtils().appLocaleLanguageCode), + label: (textScaling) => + (textScaling as num).formatAsPercentage(locale: SystemUtils().appLocaleLanguageCode), min: 0.5, max: 2.0, divisions: 15, diff --git a/lib/pages/settings/pages/settings_appearance_page.dart b/lib/pages/settings/pages/settings_appearance_page.dart index db75ae3d..7d825e8e 100644 --- a/lib/pages/settings/pages/settings_appearance_page.dart +++ b/lib/pages/settings/pages/settings_appearance_page.dart @@ -105,16 +105,12 @@ class _SettingsAppearancePageState extends ConsumerState trailing: TextButton.icon(onPressed: _openCrowdin, label: Text(context.l.settings_language_contribute)), value: locale.nativeDisplayLanguage.capitalizeFirstLetter, dialogTitle: context.l.settings_language, - options: - SupportedLanguage.values - .map( - (language) => ( - value: language.locale, - title: language.nativeName, - subtitle: language.completionFormatted, - ), - ) - .toList(), + options: SupportedLanguage.values + .map( + (language) => + (value: language.locale, title: language.nativeName, subtitle: language.completionFormatted), + ) + .toList(), initialOption: locale, onSubmitted: _submittedLanguage, ), @@ -163,10 +159,9 @@ class _SettingsAppearancePageState extends ConsumerState description: context.l.settings_app_font_description, value: appFont.displayName(context), dialogTitle: context.l.settings_app_font, - options: - Font.values - .map((font) => (value: font, title: font.displayName(context), subtitle: null)) - .toList(), + options: Font.values + .map((font) => (value: font, title: font.displayName(context), subtitle: null)) + .toList(), initialOption: appFont, onSubmitted: _submittedAppFont, ), @@ -176,10 +171,9 @@ class _SettingsAppearancePageState extends ConsumerState description: context.l.settings_editor_font_description, value: editorFont.displayName(context), dialogTitle: context.l.settings_editor_font, - options: - Font.values - .map((font) => (value: font, title: font.displayName(context), subtitle: null)) - .toList(), + options: Font.values + .map((font) => (value: font, title: font.displayName(context), subtitle: null)) + .toList(), initialOption: editorFont, onSubmitted: _submittedEditorFont, ), diff --git a/lib/pages/settings/pages/settings_backup_page.dart b/lib/pages/settings/pages/settings_backup_page.dart index 96172b2d..5200616d 100644 --- a/lib/pages/settings/pages/settings_backup_page.dart +++ b/lib/pages/settings/pages/settings_backup_page.dart @@ -152,12 +152,11 @@ class _SettingsBackupPageState extends ConsumerState { await showAdaptiveDialog( context: context, useRootNavigator: false, - builder: - (context) => AutoExportPasswordDialog( - title: context.l.settings_auto_export_encryption, - description: context.l.dialog_export_encryption_description, - secondaryDescription: context.l.dialog_export_encryption_secondary_description_auto, - ), + builder: (context) => AutoExportPasswordDialog( + title: context.l.settings_auto_export_encryption, + description: context.l.dialog_export_encryption_description, + secondaryDescription: context.l.dialog_export_encryption_secondary_description_auto, + ), ).then((autoExportPassword) async { if (autoExportPassword == null) { return; diff --git a/lib/pages/settings/pages/settings_behavior_page.dart b/lib/pages/settings/pages/settings_behavior_page.dart index 7b1ab73a..02bab051 100644 --- a/lib/pages/settings/pages/settings_behavior_page.dart +++ b/lib/pages/settings/pages/settings_behavior_page.dart @@ -138,16 +138,11 @@ class _SettingsBehaviorPageState extends ConsumerState { value: confirmations.title(context), description: context.l.settings_confirmations_description, dialogTitle: context.l.settings_confirmations, - options: - Confirmations.values - .map( - (confirmation) => ( - value: confirmation, - title: confirmation.title(context), - subtitle: null, - ), - ) - .toList(), + options: Confirmations.values + .map( + (confirmation) => (value: confirmation, title: confirmation.title(context), subtitle: null), + ) + .toList(), initialOption: confirmations, onSubmitted: submittedConfirmations, ), @@ -174,12 +169,9 @@ class _SettingsBehaviorPageState extends ConsumerState { value: availableSwipeActions.right.title(context), description: context.l.settings_swipe_action_right_description, dialogTitle: context.l.settings_swipe_action_right, - options: - AvailableSwipeAction.settings - .map( - (swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null), - ) - .toList(), + options: AvailableSwipeAction.settings + .map((swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null)) + .toList(), initialOption: availableSwipeActions.right, onSubmitted: submittedAvailableSwipeRightAction, ), @@ -189,12 +181,9 @@ class _SettingsBehaviorPageState extends ConsumerState { value: availableSwipeActions.left.title(context), description: context.l.settings_swipe_action_left_description, dialogTitle: context.l.settings_swipe_action_left, - options: - AvailableSwipeAction.settings - .map( - (swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null), - ) - .toList(), + options: AvailableSwipeAction.settings + .map((swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null)) + .toList(), initialOption: availableSwipeActions.left, onSubmitted: submittedAvailableSwipeLeftAction, ), @@ -210,12 +199,9 @@ class _SettingsBehaviorPageState extends ConsumerState { value: archivedSwipeActions.right.title(context), description: context.l.settings_swipe_action_right_description, dialogTitle: context.l.settings_swipe_action_right, - options: - ArchivedSwipeAction.values - .map( - (swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null), - ) - .toList(), + options: ArchivedSwipeAction.values + .map((swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null)) + .toList(), initialOption: archivedSwipeActions.right, onSubmitted: submittedArchivedSwipeRightAction, ), @@ -225,12 +211,9 @@ class _SettingsBehaviorPageState extends ConsumerState { value: archivedSwipeActions.left.title(context), description: context.l.settings_swipe_action_left_description, dialogTitle: context.l.settings_swipe_action_left, - options: - ArchivedSwipeAction.values - .map( - (swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null), - ) - .toList(), + options: ArchivedSwipeAction.values + .map((swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null)) + .toList(), initialOption: archivedSwipeActions.left, onSubmitted: submittedArchivedSwipeLeftAction, ), @@ -246,12 +229,9 @@ class _SettingsBehaviorPageState extends ConsumerState { value: deletedSwipeActions.right.title(context), description: context.l.settings_bin_swipe_action_right_description, dialogTitle: context.l.settings_swipe_action_right, - options: - DeletedSwipeAction.values - .map( - (swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null), - ) - .toList(), + options: DeletedSwipeAction.values + .map((swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null)) + .toList(), initialOption: deletedSwipeActions.right, onSubmitted: submittedDeletedSwipeRightAction, ), @@ -261,12 +241,9 @@ class _SettingsBehaviorPageState extends ConsumerState { value: deletedSwipeActions.left.title(context), description: context.l.settings_bin_swipe_action_left_description, dialogTitle: context.l.settings_swipe_action_left, - options: - DeletedSwipeAction.values - .map( - (swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null), - ) - .toList(), + options: DeletedSwipeAction.values + .map((swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null)) + .toList(), initialOption: deletedSwipeActions.left, onSubmitted: submittedDeletedSwipeLeftAction, ), diff --git a/lib/pages/settings/pages/settings_labels_page.dart b/lib/pages/settings/pages/settings_labels_page.dart index 65b1533a..655ccda4 100644 --- a/lib/pages/settings/pages/settings_labels_page.dart +++ b/lib/pages/settings/pages/settings_labels_page.dart @@ -120,12 +120,9 @@ class _SettingsLabelsPageState extends State { value: labelSwipeActions.right.title(context), description: context.l.settings_swipe_action_right_description, dialogTitle: context.l.settings_swipe_action_right, - options: - LabelSwipeAction.settings - .map( - (swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null), - ) - .toList(), + options: LabelSwipeAction.settings + .map((swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null)) + .toList(), initialOption: labelSwipeActions.right, onSubmitted: submittedLabelSwipeRightAction, ), @@ -135,12 +132,9 @@ class _SettingsLabelsPageState extends State { value: labelSwipeActions.left.title(context), description: context.l.settings_swipe_action_left_description, dialogTitle: context.l.settings_swipe_action_left, - options: - LabelSwipeAction.settings - .map( - (swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null), - ) - .toList(), + options: LabelSwipeAction.settings + .map((swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null)) + .toList(), initialOption: labelSwipeActions.left, onSubmitted: submittedLabelSwipeLeftAction, ), diff --git a/lib/pages/settings/pages/settings_notes_types_page.dart b/lib/pages/settings/pages/settings_notes_types_page.dart index dc0be0ad..301a6697 100644 --- a/lib/pages/settings/pages/settings_notes_types_page.dart +++ b/lib/pages/settings/pages/settings_notes_types_page.dart @@ -53,24 +53,21 @@ class _SettingsNotesTypesPageState extends ConsumerState @override Widget build(BuildContext context) { - final notesTypes = - NoteType.values.map((type) { - return (value: type, title: type.title(context), subtitle: null); - }).toList(); + final notesTypes = NoteType.values.map((type) { + return (value: type, title: type.title(context), subtitle: null); + }).toList(); final availableNotesTypes = NoteType.available; final availableNotesTypesString = NoteType.availableAsString(context); - final shareNotesTypes = - NoteType.share.map((type) { - return (value: type, title: type.title(context), subtitle: null); - }).toList(); + final shareNotesTypes = NoteType.share.map((type) { + return (value: type, title: type.title(context), subtitle: null); + }).toList(); final defaultShareNoteType = NoteType.defaultShare; final toolbarStyle = ToolbarStyle.fromPreference(); - final toolbarStyleOptions = - ToolbarStyle.values.map((toolbarStyle) { - return (value: toolbarStyle, title: toolbarStyle.title(context), subtitle: toolbarStyle.description(context)); - }).toList(); + final toolbarStyleOptions = ToolbarStyle.values.map((toolbarStyle) { + return (value: toolbarStyle, title: toolbarStyle.title(context), subtitle: toolbarStyle.description(context)); + }).toList(); final useParagraphsSpacing = PreferenceKey.useParagraphsSpacing.preferenceOrDefault; return Scaffold( diff --git a/lib/providers/labels/labels/labels_provider.dart b/lib/providers/labels/labels/labels_provider.dart index a35b993b..af6a44f4 100644 --- a/lib/providers/labels/labels/labels_provider.dart +++ b/lib/providers/labels/labels/labels_provider.dart @@ -83,10 +83,9 @@ class Labels extends _$Labels { return false; } - final labels = - (state.value ?? []) - ..removeWhere((label) => labelsToToggle.contains(label)) - ..addAll(labelsToToggle); + final labels = (state.value ?? []) + ..removeWhere((label) => labelsToToggle.contains(label)) + ..addAll(labelsToToggle); state = AsyncData(labels.sorted()); @@ -112,10 +111,9 @@ class Labels extends _$Labels { return false; } - final labels = - (state.value ?? []) - ..removeWhere((label) => labelsToToggle.contains(label)) - ..addAll(labelsToToggle); + final labels = (state.value ?? []) + ..removeWhere((label) => labelsToToggle.contains(label)) + ..addAll(labelsToToggle); state = AsyncData(labels.sorted()); @@ -138,10 +136,9 @@ class Labels extends _$Labels { return false; } - final labels = - (state.value ?? []) - ..removeWhere((label) => labelsToToggle.contains(label)) - ..addAll(labelsToToggle); + final labels = (state.value ?? []) + ..removeWhere((label) => labelsToToggle.contains(label)) + ..addAll(labelsToToggle); state = AsyncData(labels.sorted()); diff --git a/lib/providers/notes/notes_provider.dart b/lib/providers/notes/notes_provider.dart index fd7f4693..620e6dc5 100644 --- a/lib/providers/notes/notes_provider.dart +++ b/lib/providers/notes/notes_provider.dart @@ -25,10 +25,9 @@ class Notes extends _$Notes { try { switch (status) { case NoteStatus.available: - notes = - label != null - ? await _notesService.getAllAvailableFilteredByLabel(label: label!) - : await _notesService.getAllAvailable(); + notes = label != null + ? await _notesService.getAllAvailableFilteredByLabel(label: label!) + : await _notesService.getAllAvailable(); case NoteStatus.archived: notes = await _notesService.getAllArchived(); case NoteStatus.deleted: @@ -121,10 +120,9 @@ class Notes extends _$Notes { return false; } - final notes = - (state.value ?? []) - ..removeWhere((note) => notesWhereToAdd.contains(note)) - ..addAll(notesWhereToAdd); + final notes = (state.value ?? []) + ..removeWhere((note) => notesWhereToAdd.contains(note)) + ..addAll(notesWhereToAdd); state = AsyncData(notes.sorted()); _updateUnlabeledProvider(); @@ -148,10 +146,9 @@ class Notes extends _$Notes { return false; } - final notes = - (state.value ?? []) - ..removeWhere((note) => notesToToggle.contains(note)) - ..addAll(notesToToggle); + final notes = (state.value ?? []) + ..removeWhere((note) => notesToToggle.contains(note)) + ..addAll(notesToToggle); state = AsyncData(notes.sorted()); _updateUnlabeledProvider(); @@ -178,10 +175,9 @@ class Notes extends _$Notes { return false; } - final notes = - (state.value ?? []) - ..removeWhere((note) => notesToToggle.contains(note)) - ..addAll(notesToToggle); + final notes = (state.value ?? []) + ..removeWhere((note) => notesToToggle.contains(note)) + ..addAll(notesToToggle); state = AsyncData(notes.sorted()); _updateUnlabeledProvider(); diff --git a/lib/providers/notifiers/notifiers.dart b/lib/providers/notifiers/notifiers.dart index 5e398e4c..65587a8a 100644 --- a/lib/providers/notifiers/notifiers.dart +++ b/lib/providers/notifiers/notifiers.dart @@ -35,9 +35,6 @@ final fleatherControllerCanUndoNotifier = ValueNotifier(false); /// Notifier for whether the redo action can be used on the currently displayed note. final fleatherControllerCanRedoNotifier = ValueNotifier(false); -/// Notifier for whether the editor has focus. -final editorHasFocusNotifier = ValueNotifier(false); - /// Notifier for whether the editor is in edit mode. final isEditModeNotifier = ValueNotifier(!PreferenceKey.openEditorReadingMode.preferenceOrDefault); diff --git a/lib/services/backup/backup_service.dart b/lib/services/backup/backup_service.dart index ebb49c1d..36206904 100644 --- a/lib/services/backup/backup_service.dart +++ b/lib/services/backup/backup_service.dart @@ -105,11 +105,10 @@ class ManualBackupService { final password = await showAdaptiveDialog( context: context, useRootNavigator: false, - builder: - (context) => AutoExportPasswordDialog( - title: context.l.settings_import, - description: context.l.dialog_import_encryption_password_description, - ), + builder: (context) => AutoExportPasswordDialog( + title: context.l.settings_import, + description: context.l.dialog_import_encryption_password_description, + ), ); if (password == null) { diff --git a/lib/services/migration/migration_service.dart b/lib/services/migration/migration_service.dart index 3e574a75..bb2eabfc 100644 --- a/lib/services/migration/migration_service.dart +++ b/lib/services/migration/migration_service.dart @@ -40,21 +40,20 @@ class MigrationService { await _databaseService.database.notes.clear(); // Migrate the notes - final migratedNotes = - notes - .map( - (oldNote) => RichTextNote( - archived: false, - deleted: oldNote.deleted, - pinned: oldNote.pinned, - locked: false, - createdTime: oldNote.createdTime, - editedTime: oldNote.editedTime, - title: oldNote.title, - content: oldNote.content, - ), - ) - .toList(); + final migratedNotes = notes + .map( + (oldNote) => RichTextNote( + archived: false, + deleted: oldNote.deleted, + pinned: oldNote.pinned, + locked: false, + createdTime: oldNote.createdTime, + editedTime: oldNote.editedTime, + title: oldNote.title, + content: oldNote.content, + ), + ) + .toList(); // Add the migrated notes to the new collection with their labels await _notesService.putAll(migratedNotes); @@ -80,16 +79,14 @@ class MigrationService { await _notesService.deleteAll(richTextNotes); // Migrate the notes - final migratedNotes = - richTextNotes - .map( - (richTextNote) => - richTextNote - ..id = uuid.v4() - ..archived = false - ..deletedTime = richTextNote.deleted ? DateTime.timestamp() : null, - ) - .toList(); + final migratedNotes = richTextNotes + .map( + (richTextNote) => richTextNote + ..id = uuid.v4() + ..archived = false + ..deletedTime = richTextNote.deleted ? DateTime.timestamp() : null, + ) + .toList(); // Put back the migrated notes with the right IDs await _notesService.putAll(migratedNotes); diff --git a/lib/services/notes/notes_service.dart b/lib/services/notes/notes_service.dart index 89595137..95755a12 100644 --- a/lib/services/notes/notes_service.dart +++ b/lib/services/notes/notes_service.dart @@ -322,17 +322,16 @@ class NotesService { Future removeFromBin(Duration delay) async { final deletedNotes = await getAllDeleted(); - final notesToRemove = - deletedNotes.where((note) { - if (note.deletedTime == null) { - return false; - } + final notesToRemove = deletedNotes.where((note) { + if (note.deletedTime == null) { + return false; + } - final now = DateTime.timestamp(); - final durationSinceDeleted = now.difference(note.deletedTime!); + final now = DateTime.timestamp(); + final durationSinceDeleted = now.difference(note.deletedTime!); - return durationSinceDeleted > delay; - }).toList(); + return durationSinceDeleted > delay; + }).toList(); if (notesToRemove.isEmpty) { return; diff --git a/pubspec.lock b/pubspec.lock index 996fbb63..f6b7eb37 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -42,10 +42,10 @@ packages: dependency: transitive description: name: animated_reorderable_list - sha256: "1e6fc4341a80ade13f09e8c192c2f49b33ffa4a9b0046425b9f6f93f2e7fedd4" + sha256: "5de5cca556a8c9c8f7b65234ae4b683593dc6e167db498744a5e389302f24d13" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" ansicolor: dependency: transitive description: @@ -82,10 +82,10 @@ packages: dependency: transitive description: name: async - sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" url: "https://pub.dev" source: hosted - version: "2.12.0" + version: "2.13.0" boolean_selector: dependency: transitive description: @@ -206,6 +206,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.1.0" + cli_config: + dependency: transitive + description: + name: cli_config + sha256: ac20a183a07002b700f0c25e61b7ee46b23c309d76ab7b7640a028f18e4d99ec + url: "https://pub.dev" + source: hosted + version: "0.2.0" cli_util: dependency: transitive description: @@ -258,10 +266,10 @@ packages: dependency: transitive description: name: coverage - sha256: c1fb2dce3c0085f39dc72668e85f8e0210ec7de05345821ff58530567df345a5 + sha256: aa07dbe5f2294c827b7edb9a87bba44a9c15a3cc81bc8da2ca19b37322d30080 url: "https://pub.dev" source: hosted - version: "1.9.2" + version: "1.14.1" cross_file: dependency: transitive description: @@ -394,10 +402,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.3.3" ffi: dependency: transitive description: @@ -463,10 +471,10 @@ packages: dependency: "direct main" description: name: flutter_checklist - sha256: "7545c00436290730e7702e9a9fd1035e01a2b73bcccb1fc91e59be2b03e61715" + sha256: ff23a2bd629478e611e1a6c88b0a56e084180c815748f03a1191a6e636841739 url: "https://pub.dev" source: hosted - version: "1.5.1" + version: "1.5.2" flutter_displaymode: dependency: "direct main" description: @@ -503,10 +511,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "6.0.0" flutter_localizations: dependency: "direct main" description: flutter @@ -678,10 +686,10 @@ packages: dependency: transitive description: name: hotreloader - sha256: ed56fdc1f3a8ac924e717257621d09e9ec20e308ab6352a73a50a1d7a4d9158e + sha256: bc167a1163807b03bada490bfe2df25b0d744df359227880220a5cbd04e5734b url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "4.3.0" html: dependency: transitive description: @@ -726,10 +734,10 @@ packages: dependency: "direct main" description: name: intl - sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" url: "https://pub.dev" source: hosted - version: "0.19.0" + version: "0.20.2" io: dependency: transitive description: @@ -798,10 +806,10 @@ packages: dependency: transitive description: name: leak_tracker - sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" url: "https://pub.dev" source: hosted - version: "10.0.8" + version: "10.0.9" leak_tracker_flutter_testing: dependency: transitive description: @@ -822,10 +830,10 @@ packages: dependency: transitive description: name: lints - sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413" + sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "6.0.0" local_auth: dependency: "direct main" description: @@ -838,10 +846,10 @@ packages: dependency: transitive description: name: local_auth_android - sha256: "6763aaf8965f21822624cb2fd3c03d2a8b3791037b5efb0fe4b13e110f5afc92" + sha256: "63ad7ca6396290626dc0cb34725a939e4cfe965d80d36112f08d49cf13a8136e" url: "https://pub.dev" source: hosted - version: "1.0.46" + version: "1.0.49" local_auth_darwin: dependency: transitive description: @@ -1636,10 +1644,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 url: "https://pub.dev" source: hosted - version: "14.3.1" + version: "15.0.0" watcher: dependency: transitive description: @@ -1729,5 +1737,5 @@ packages: source: hosted version: "3.1.3" sdks: - dart: ">=3.7.2 <4.0.0" - flutter: ">=3.29.3" + dart: ">=3.8.0 <4.0.0" + flutter: ">=3.32.0" diff --git a/pubspec.yaml b/pubspec.yaml index 53d3082b..77c0a9f7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,8 +6,8 @@ version: 2.0.0+28 publish_to: none environment: - sdk: ^3.7.2 - flutter: 3.29.3 + sdk: ^3.8.0 + flutter: 3.32.0 dependencies: after_layout: ^1.2.0 @@ -24,7 +24,7 @@ dependencies: flex_color_picker: ^3.7.1 flutter: sdk: flutter - flutter_checklist: ^1.5.1 + flutter_checklist: ^1.5.2 flutter_displaymode: ^0.6.0 flutter_expandable_fab: 2.4.1 flutter_fgbg: ^0.7.1 @@ -38,7 +38,7 @@ dependencies: flutter_staggered_grid_view: ^0.7.0 gap: ^3.0.1 go_router: ^15.1.2 - intl: ^0.19.0 + intl: ^0.20.2 is_first_run: ^1.0.0 isar: version: ^3.1.8 @@ -82,7 +82,7 @@ dev_dependencies: build_verify: ^3.1.0 custom_lint: ^0.7.0 flutter_launcher_icons: ^0.14.3 - flutter_lints: ^5.0.0 + flutter_lints: ^6.0.0 isar_generator: version: ^3.1.8 hosted: https://pub.isar-community.dev/ From a726fbed668b1790e17cf06c344017f7e5d5b8c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Chiotti?= <44336112+maelchiotti@users.noreply.github.com> Date: Fri, 13 Jun 2025 12:09:41 +0200 Subject: [PATCH 2/9] [468] feat: open links in markdown read mode (#473) --- .../editor/widgets/editors/markdown_editor.dart | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/pages/editor/widgets/editors/markdown_editor.dart b/lib/pages/editor/widgets/editors/markdown_editor.dart index 94869376..ccc987ae 100644 --- a/lib/pages/editor/widgets/editors/markdown_editor.dart +++ b/lib/pages/editor/widgets/editors/markdown_editor.dart @@ -3,6 +3,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_markdown_plus/flutter_markdown_plus.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:markdown/markdown.dart'; +import 'package:url_launcher/url_launcher.dart'; import '../../../../common/constants/constants.dart'; import '../../../../common/constants/paddings.dart'; @@ -55,6 +56,16 @@ class _MarkdownEditorState extends ConsumerState { ref.read(notesProvider(status: NoteStatus.available, label: currentLabelFilter).notifier).edit(note); } + void onOpenLink(String text, String? href, String title) { + if (href == null) { + return; + } + + Uri uri = Uri.parse(href); + + launchUrl(uri); + } + @override Widget build(BuildContext context) { final theme = Theme.of(context); @@ -77,6 +88,7 @@ class _MarkdownEditorState extends ConsumerState { borderRadius: BorderRadius.circular(2.0), ), ), + onTapLink: onOpenLink, ) : TextField( controller: contentTextController, From 374b58bff8351c921246f0deeca18258a8c36f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Chiotti?= <44336112+maelchiotti@users.noreply.github.com> Date: Fri, 13 Jun 2025 13:51:53 +0200 Subject: [PATCH 3/9] [470] fix: missing translations for libraries (#474) --- lib/pages/editor/widgets/toolbar/heading_toolbar_button.dart | 4 +++- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/pages/editor/widgets/toolbar/heading_toolbar_button.dart b/lib/pages/editor/widgets/toolbar/heading_toolbar_button.dart index 3688c757..53f8d030 100644 --- a/lib/pages/editor/widgets/toolbar/heading_toolbar_button.dart +++ b/lib/pages/editor/widgets/toolbar/heading_toolbar_button.dart @@ -1,4 +1,5 @@ import 'package:fleather/fleather.dart'; +import 'package:fleather/l10n/fleather_localizations_en.g.dart'; import 'package:flutter/material.dart'; /// Heading toolbar button. @@ -53,7 +54,8 @@ class _HeadingToolbarButtonState extends State { /// Returns the title of the [attribute]. String getAttributeTitle(ParchmentAttribute attribute) { - final localizations = FleatherLocalizations.of(context)!; + final localizations = FleatherLocalizations.of(context) ?? FleatherLocalizationsEn(); + return switch (attribute.value) { null => localizations.headingNormal, 1 => localizations.headingLevel1, diff --git a/pubspec.lock b/pubspec.lock index f6b7eb37..245bdbc4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -471,10 +471,10 @@ packages: dependency: "direct main" description: name: flutter_checklist - sha256: ff23a2bd629478e611e1a6c88b0a56e084180c815748f03a1191a6e636841739 + sha256: "792decb149d84e0591a6bbbcd288d625740ce32ad77c30f23bed762ea544edc8" url: "https://pub.dev" source: hosted - version: "1.5.2" + version: "1.5.3" flutter_displaymode: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 77c0a9f7..4d9d3c4a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,7 +24,7 @@ dependencies: flex_color_picker: ^3.7.1 flutter: sdk: flutter - flutter_checklist: ^1.5.2 + flutter_checklist: ^1.5.3 flutter_displaymode: ^0.6.0 flutter_expandable_fab: 2.4.1 flutter_fgbg: ^0.7.1 From ac61238114a6cc120abbbb24d287b33338d51e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Chiotti?= <44336112+maelchiotti@users.noreply.github.com> Date: Fri, 13 Jun 2025 14:19:07 +0200 Subject: [PATCH 4/9] [454] fix: rich text links colors (#475) --- lib/navigation/router.dart | 16 ++++++++-------- .../editor/widgets/editors/rich_text_editor.dart | 4 +++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/navigation/router.dart b/lib/navigation/router.dart index ad34c3c5..658294c0 100644 --- a/lib/navigation/router.dart +++ b/lib/navigation/router.dart @@ -36,24 +36,24 @@ final router = GoRouter.routingConfig( ); /// The router redirection function. -// ignore: prefer_function_declarations_over_variables -final goRouterRedirect = (BuildContext context, GoRouterState state) { +String? goRouterRedirect(BuildContext context, GoRouterState state) { final lockApp = PreferenceKey.lockApp.preferenceOrDefault; + final isLocked = lockAppNotifier.value; if (!lockApp) { return null; } - if (lockAppNotifier.value) { + if (isLocked && state.matchedLocation != NavigationRoute.lock.path) { return NavigationRoute.lock.path; - } else { - if (state.matchedLocation == NavigationRoute.lock.path) { - return NavigationRoute.notes.path; - } + } + + if (!isLocked && state.matchedLocation == NavigationRoute.lock.path) { + return NavigationRoute.notes.path; } return null; -}; +} /// The lock route. final lockRoute = GoRoute( diff --git a/lib/pages/editor/widgets/editors/rich_text_editor.dart b/lib/pages/editor/widgets/editors/rich_text_editor.dart index 976669d7..38c1681d 100644 --- a/lib/pages/editor/widgets/editors/rich_text_editor.dart +++ b/lib/pages/editor/widgets/editors/rich_text_editor.dart @@ -89,6 +89,8 @@ class _RichTextEditorState extends ConsumerState { widget.fleatherController.addListener(() => onChanged()); + final linkColor = Theme.brightnessOf(context) == Brightness.light ? Colors.blue[800] : Colors.blue[200]; + return Padding( padding: Paddings.pageHorizontal, child: DefaultTextStyle.merge( @@ -100,7 +102,7 @@ class _RichTextEditorState extends ConsumerState { paragraph: !useParagraphsSpacing ? TextBlockTheme(style: fleatherThemeFallback.paragraph.style, spacing: const VerticalSpacing.zero()) : null, - link: fleatherThemeFallback.link.copyWith(color: Theme.of(context).colorScheme.primary), + link: fleatherThemeFallback.link.copyWith(color: linkColor, decorationColor: linkColor), ); return FleatherTheme( From a1046fc538d3f4fac803edac33dde1db8b2268ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Chiotti?= <44336112+maelchiotti@users.noreply.github.com> Date: Fri, 11 Jul 2025 11:30:56 +0200 Subject: [PATCH 5/9] [469] fix: json exports (#476) --- lib/models/note/note.dart | 2 +- lib/models/note/types/note_type.dart | 2 + pubspec.lock | 304 +++++++++++++-------------- pubspec.yaml | 28 +-- 4 files changed, 169 insertions(+), 167 deletions(-) diff --git a/lib/models/note/note.dart b/lib/models/note/note.dart index e4583aa2..f425d32e 100644 --- a/lib/models/note/note.dart +++ b/lib/models/note/note.dart @@ -38,7 +38,7 @@ sealed class Note implements Comparable { /// The type of the note. @ignore - @JsonKey(includeFromJson: false) + @JsonKey(includeToJson: true, includeFromJson: false) NoteType type; /// Whether the note is archived. diff --git a/lib/models/note/types/note_type.dart b/lib/models/note/types/note_type.dart index aa62e924..4218585f 100644 --- a/lib/models/note/types/note_type.dart +++ b/lib/models/note/types/note_type.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:json_annotation/json_annotation.dart'; import 'package:material_symbols_icons/material_symbols_icons.dart'; import '../../../common/extensions/build_context_extension.dart'; @@ -6,6 +7,7 @@ import '../../../common/extensions/string_extension.dart'; import '../../../common/preferences/preference_key.dart'; /// The types of notes. +@JsonEnum() enum NoteType { /// Plain text note. plainText(Icons.text_fields), diff --git a/pubspec.lock b/pubspec.lock index 245bdbc4..071f52c4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -74,10 +74,10 @@ packages: dependency: transitive description: name: asn1lib - sha256: "4bae5ae63e6d6dd17c4aac8086f3dec26c0236f6a0f03416c6c19d830c367cf5" + sha256: "9a8f69025044eb466b9b60ef3bc3ac99b4dc6c158ae9c56d25eeccf5bc56d024" url: "https://pub.dev" source: hosted - version: "1.5.8" + version: "1.6.5" async: dependency: transitive description: @@ -98,10 +98,10 @@ packages: dependency: transitive description: name: build - sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + sha256: "51dc711996cbf609b90cbe5b335bbce83143875a9d58e4b5c6d3c4f684d3dda7" url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.5.4" build_cli_annotations: dependency: transitive description: @@ -114,50 +114,50 @@ packages: dependency: transitive description: name: build_config - sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" build_daemon: dependency: transitive description: name: build_daemon - sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9" + sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.0.4" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: b9e4fda21d846e192628e7a4f6deda6888c36b5b69ba02ff291a01fd529140f0 + sha256: ee4257b3f20c0c90e72ed2b57ad637f694ccba48839a821e87db762548c22a62 url: "https://pub.dev" source: hosted - version: "2.4.4" + version: "2.5.4" build_runner: dependency: "direct dev" description: name: build_runner - sha256: "058fe9dce1de7d69c4b84fada934df3e0153dd000758c4d65964d0166779aa99" + sha256: "382a4d649addbfb7ba71a3631df0ec6a45d5ab9b098638144faf27f02778eb53" url: "https://pub.dev" source: hosted - version: "2.4.15" + version: "2.5.4" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021" + sha256: "85fbbb1036d576d966332a3f5ce83f2ce66a40bea1a94ad2d5fc29a19a0d3792" url: "https://pub.dev" source: hosted - version: "8.0.0" + version: "9.1.2" build_verify: dependency: "direct dev" description: name: build_verify - sha256: abbb9b9eda076854ac1678d284c053a5ec608e64da741d0801f56d4bbea27e23 + sha256: "3b17b59b6d66f9d3e6014996f089902d56cec5760e051c353cc387b9da577652" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.1" built_collection: dependency: transitive description: @@ -170,10 +170,10 @@ packages: dependency: transitive description: name: built_value - sha256: c7913a9737ee4007efedaffc968c049fd0f3d0e49109e778edc10de9426005cb + sha256: "082001b5c3dc495d4a42f1d5789990505df20d8547d42507c29050af6933ee27" url: "https://pub.dev" source: hosted - version: "8.9.2" + version: "8.10.1" chalkdart: dependency: transitive description: @@ -194,10 +194,10 @@ packages: dependency: transitive description: name: checked_yaml - sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f" url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "2.0.4" ci: dependency: transitive description: @@ -218,10 +218,10 @@ packages: dependency: transitive description: name: cli_util - sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19 + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c url: "https://pub.dev" source: hosted - version: "0.4.1" + version: "0.4.2" clock: dependency: transitive description: @@ -234,10 +234,10 @@ packages: dependency: transitive description: name: code_builder - sha256: f692079e25e7869c14132d39f223f8eec9830eb76131925143b2129c4bb01b37 + sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" url: "https://pub.dev" source: hosted - version: "4.10.0" + version: "4.10.1" collection: dependency: "direct main" description: @@ -258,18 +258,18 @@ packages: dependency: transitive description: name: convert - sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" coverage: dependency: transitive description: name: coverage - sha256: aa07dbe5f2294c827b7edb9a87bba44a9c15a3cc81bc8da2ca19b37322d30080 + sha256: "5da775aa218eaf2151c721b16c01c7676fbfdd99cebba2bf64e8b807a28ff94d" url: "https://pub.dev" source: hosted - version: "1.14.1" + version: "1.15.0" cross_file: dependency: transitive description: @@ -282,18 +282,18 @@ packages: dependency: transitive description: name: crypto - sha256: "1dceb0cf05cb63a7852c11560060e53ec2f182079a16ced6f4395c5b0875baf8" + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" url: "https://pub.dev" source: hosted - version: "3.0.4" + version: "3.0.6" csslib: dependency: transitive description: name: csslib - sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" + sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.2" custom_lint: dependency: "direct dev" description: @@ -330,18 +330,18 @@ packages: dependency: "direct main" description: name: dart_helper_utils - sha256: fdd84a6cdeda490a46fc40c4b0e97179166f1b525b4e0912e103464ab47c6ffa + sha256: "450375d2d19a6a16564c0388663c5082f673489279c3d12cf046b6bf5504f3c4" url: "https://pub.dev" source: hosted - version: "5.1.0" + version: "5.2.0" dart_style: dependency: transitive description: name: dart_style - sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab" + sha256: "7306ab8a2359a48d22310ad823521d723acfed60ee1f7e37388e8986853b6820" url: "https://pub.dev" source: hosted - version: "2.3.7" + version: "2.3.8" dartx: dependency: transitive description: @@ -354,18 +354,18 @@ packages: dependency: "direct main" description: name: device_info_plus - sha256: "0c6396126421b590089447154c5f98a5de423b70cfb15b1578fd018843ee6f53" + sha256: "98f28b42168cc509abc92f88518882fd58061ea372d7999aecc424345c7bff6a" url: "https://pub.dev" source: hosted - version: "11.4.0" + version: "11.5.0" device_info_plus_platform_interface: dependency: transitive description: name: device_info_plus_platform_interface - sha256: "0b04e02b30791224b31969eb1b50d723498f402971bff3630bca2ba839bd1ed2" + sha256: e1ea89119e34903dca74b883d0dd78eb762814f97fb6c76f35e9ff74d261a18f url: "https://pub.dev" source: hosted - version: "7.0.2" + version: "7.0.3" diff_match_patch: dependency: transitive description: @@ -426,10 +426,10 @@ packages: dependency: transitive description: name: fixnum - sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" flag_secure: dependency: "direct main" description: @@ -442,10 +442,10 @@ packages: dependency: "direct main" description: name: fleather - sha256: "67d5825c58915d10c89d51d6b7a610cb97c654316ef12517e09c228531d9c836" + sha256: a0fba8a9ee19f5df679a78e09e6c43f65980d32448be92a783b6a489b566393e url: "https://pub.dev" source: hosted - version: "1.22.0" + version: "1.24.0+1" flex_color_picker: dependency: "direct main" description: @@ -458,10 +458,10 @@ packages: dependency: transitive description: name: flex_seed_scheme - sha256: d3ba3c5c92d2d79d45e94b4c6c71d01fac3c15017da1545880c53864da5dfeb0 + sha256: b06d8b367b84cbf7ca5c5603c858fa5edae88486c4e4da79ac1044d73b6c62ec url: "https://pub.dev" source: hosted - version: "3.5.0" + version: "3.5.1" flutter: dependency: "direct main" description: flutter @@ -487,10 +487,10 @@ packages: dependency: "direct main" description: name: flutter_expandable_fab - sha256: "4d03f54e5384897e32606e9959cef5e7857e5a203e24684f95dfbb5f7fb9b88e" + sha256: "2a488600924fd2a041679ad889807ee5670414a7a518cf11d4854b9898b3504f" url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.5.2" flutter_fgbg: dependency: "direct main" description: @@ -503,10 +503,10 @@ packages: dependency: "direct dev" description: name: flutter_launcher_icons - sha256: bfa04787c85d80ecb3f8777bde5fc10c3de809240c48fa061a2c2bf15ea5211c + sha256: "10f13781741a2e3972126fae08393d3c4e01fa4cd7473326b94b72cf594195e7" url: "https://pub.dev" source: hosted - version: "0.14.3" + version: "0.14.4" flutter_lints: dependency: "direct dev" description: @@ -548,10 +548,10 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: "615a505aef59b151b46bbeef55b36ce2b6ed299d160c51d84281946f0aa0ce0e" + sha256: f948e346c12f8d5480d2825e03de228d0eb8c3a737e4cdaa122267b89c022b5e url: "https://pub.dev" source: hosted - version: "2.0.24" + version: "2.0.28" flutter_riverpod: dependency: "direct main" description: @@ -580,10 +580,10 @@ packages: dependency: transitive description: name: flutter_secure_storage_linux - sha256: bf7404619d7ab5c0a1151d7c4e802edad8f33535abfbeff2f9e1fe1274e2d705 + sha256: be76c1d24a97d0b98f8b54bce6b481a380a6590df992d0098f868ad54dc8f688 url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.2.3" flutter_secure_storage_macos: dependency: transitive description: @@ -662,18 +662,18 @@ packages: dependency: transitive description: name: glob - sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" go_router: dependency: "direct main" description: name: go_router - sha256: "0b1e06223bee260dee31a171fb1153e306907563a0b0225e8c1733211911429a" + sha256: c489908a54ce2131f1d1b7cc631af9c1a06fac5ca7c449e959192089f9489431 url: "https://pub.dev" source: hosted - version: "15.1.2" + version: "16.0.0" graphs: dependency: transitive description: @@ -694,34 +694,34 @@ packages: dependency: transitive description: name: html - sha256: "1fc58edeaec4307368c60d59b7e15b9d658b57d7f3125098b6294153c75337ec" + sha256: "6d1264f2dffa1b1101c25a91dff0dc2daee4c18e87cd8538729773c073dbf602" url: "https://pub.dev" source: hosted - version: "0.15.5" + version: "0.15.6" http: dependency: transitive description: name: http - sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 + sha256: "2c11f3f94c687ee9bad77c171151672986360b2b001d109814ee7140b2cf261b" url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.4.0" http_multi_server: dependency: transitive description: name: http_multi_server - sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 url: "https://pub.dev" source: hosted - version: "3.2.1" + version: "3.2.2" http_parser: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.2" image: dependency: transitive description: @@ -742,10 +742,10 @@ packages: dependency: transitive description: name: io - sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.5" is_first_run: dependency: "direct main" description: @@ -854,10 +854,10 @@ packages: dependency: transitive description: name: local_auth_darwin - sha256: "630996cd7b7f28f5ab92432c4b35d055dd03a747bc319e5ffbb3c4806a3e50d2" + sha256: "25163ce60a5a6c468cf7a0e3dc8a165f824cabc2aa9e39a5e9fc5c2311b7686f" url: "https://pub.dev" source: hosted - version: "1.4.3" + version: "1.5.0" local_auth_platform_interface: dependency: transitive description: @@ -886,18 +886,18 @@ packages: dependency: "direct main" description: name: logger - sha256: be4b23575aac7ebf01f225a241eb7f6b5641eeaf43c6a8613510fc2f8cf187d1 + sha256: "2621da01aabaf223f8f961e751f2c943dbb374dc3559b982f200ccedadaa6999" url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.6.0" logging: dependency: transitive description: name: logging - sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" macros: dependency: transitive description: @@ -934,10 +934,10 @@ packages: dependency: "direct main" description: name: material_symbols_icons - sha256: d45b6c36c3effa8cb51b1afb8698107d5ff1f88fa4631428f34a8a01abc295d7 + sha256: "7c50901b39d1ad645ee25d920aed008061e1fd541a897b4ebf2c01d966dbf16b" url: "https://pub.dev" source: hosted - version: "4.2815.0" + version: "4.2815.1" meta: dependency: transitive description: @@ -974,10 +974,10 @@ packages: dependency: transitive description: name: package_config - sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.2.0" package_info_plus: dependency: "direct main" description: @@ -998,10 +998,10 @@ packages: dependency: "direct main" description: name: parchment - sha256: "5b957b973f83ae4207edbcb52665d1fdc18a55a76829bc7d50ecdf12838dfeed" + sha256: "579d98303e285f9f982d5cea0fa3768cd78105173a6f6666bf93d2b9e2bfc798" url: "https://pub.dev" source: hosted - version: "1.22.0" + version: "1.24.0" parchment_delta: dependency: "direct main" description: @@ -1030,18 +1030,18 @@ packages: dependency: transitive description: name: path_provider_android - sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7" + sha256: d0d310befe2c8ab9e7f393288ccbb11b60c019c6b5afc21973eeee4dda2b35e9 url: "https://pub.dev" source: hosted - version: "2.2.10" + version: "2.2.17" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 + sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.1" path_provider_linux: dependency: transitive description: @@ -1070,18 +1070,18 @@ packages: dependency: transitive description: name: petitparser - sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" url: "https://pub.dev" source: hosted - version: "6.0.2" + version: "6.1.0" platform: dependency: transitive description: name: platform - sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" url: "https://pub.dev" source: hosted - version: "3.1.5" + version: "3.1.6" plugin_platform_interface: dependency: transitive description: @@ -1110,26 +1110,26 @@ packages: dependency: transitive description: name: posix - sha256: f0d7856b6ca1887cfa6d1d394056a296ae33489db914e365e2044fdada449e62 + sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61" url: "https://pub.dev" source: hosted - version: "6.0.2" + version: "6.0.3" pub_semver: dependency: transitive description: name: pub_semver - sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" pubspec_parse: dependency: transitive description: name: pubspec_parse - sha256: c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8 + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.5.0" quick_actions: dependency: "direct main" description: @@ -1142,10 +1142,10 @@ packages: dependency: transitive description: name: quick_actions_android - sha256: "54a581491b90ff2e1be94af84a40c05e806e232184bb32afa2df57b07c4d6882" + sha256: "8d88e90a236ffe92f1026ecc3b85acfefedffccb0c1be1c94c1c0298e8483ad8" url: "https://pub.dev" source: hosted - version: "1.0.15" + version: "1.0.21" quick_actions_ios: dependency: transitive description: @@ -1166,10 +1166,10 @@ packages: dependency: transitive description: name: quiver - sha256: b1c1ac5ce6688d77f65f3375a9abb9319b3cb32486bdc7a1e0fdf004d7ba4e47 + sha256: ea0b925899e64ecdfbf9c7becb60d5b50e706ade44a85b2363be2a22d88117d2 url: "https://pub.dev" source: hosted - version: "3.2.1" + version: "3.2.2" receive_sharing_intent: dependency: "direct main" description: @@ -1247,18 +1247,18 @@ packages: dependency: "direct main" description: name: saf_stream - sha256: f48b9f134d0cd1047a0f58539e967400f3a15846482911a2d892b1851385ce27 + sha256: "417501ced1caeb98958524e1a93e64be87af203395a7ba7bb1da47b19234ccf1" url: "https://pub.dev" source: hosted - version: "0.11.2" + version: "0.11.3" saf_util: dependency: "direct main" description: name: saf_util - sha256: c2b5f0642059a11f4c41b056e2d5eabc7350f7bc3b1cadb6db187d2f84108330 + sha256: b18e57677fc704918b2a67d7b5aa1c9c61dc5f3f2e7e70480576db77d18bec4a url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.10.0" sanitize_filename: dependency: "direct main" description: @@ -1303,18 +1303,18 @@ packages: dependency: transitive description: name: shared_preferences_android - sha256: "02a7d8a9ef346c9af715811b01fbd8e27845ad2c41148eefd31321471b41863d" + sha256: "20cbd561f743a342c76c151d6ddb93a9ce6005751e7aa458baad3858bfbfb6ac" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.10" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation - sha256: c4b35f6cb8f63c147312c054ce7c2254c8066745125264f0c88739c417fc9d9f + sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03" url: "https://pub.dev" source: hosted - version: "2.5.2" + version: "2.5.4" shared_preferences_linux: dependency: transitive description: @@ -1335,10 +1335,10 @@ packages: dependency: transitive description: name: shared_preferences_web - sha256: d2ca4132d3946fec2184261726b355836a82c33d7d5b67af32692aff18a4684e + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.4.3" shared_preferences_windows: dependency: transitive description: @@ -1351,10 +1351,10 @@ packages: dependency: transitive description: name: shelf - sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 url: "https://pub.dev" source: hosted - version: "1.4.1" + version: "1.4.2" shelf_packages_handler: dependency: transitive description: @@ -1375,10 +1375,10 @@ packages: dependency: transitive description: name: shelf_web_socket - sha256: "073c147238594ecd0d193f3456a5fe91c4b0abbcc68bf5cd95b36c4e194ac611" + sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "3.0.0" simple_icons: dependency: "direct main" description: @@ -1404,10 +1404,10 @@ packages: dependency: transitive description: name: source_helper - sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd" + sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c" url: "https://pub.dev" source: hosted - version: "1.3.4" + version: "1.3.5" source_map_stack_trace: dependency: transitive description: @@ -1420,10 +1420,10 @@ packages: dependency: transitive description: name: source_maps - sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" + sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812" url: "https://pub.dev" source: hosted - version: "0.10.12" + version: "0.10.13" source_span: dependency: transitive description: @@ -1468,10 +1468,10 @@ packages: dependency: transitive description: name: stream_transform - sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: @@ -1484,10 +1484,10 @@ packages: dependency: "direct main" description: name: string_validator - sha256: a278d038104aa2df15d0e09c47cb39a49f907260732067d0034dc2f2e4e2ac94 + sha256: "240f4c98027dfbe8639c8271ef18cc9de735b47067aa15a720cfed9576a512b1" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" substring_highlight: dependency: "direct main" description: @@ -1532,26 +1532,26 @@ packages: dependency: transitive description: name: time - sha256: ad8e018a6c9db36cb917a031853a1aae49467a93e0d464683e029537d848c221 + sha256: "370572cf5d1e58adcb3e354c47515da3f7469dac3a95b447117e728e7be6f461" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" timing: dependency: transitive description: name: timing - sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.2" typed_data: dependency: transitive description: name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.4.0" universal_io: dependency: transitive description: @@ -1564,42 +1564,42 @@ packages: dependency: "direct main" description: name: url_launcher - sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603" + sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8 url: "https://pub.dev" source: hosted - version: "6.3.1" + version: "6.3.2" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: f0c73347dfcfa5b3db8bc06e1502668265d39c08f310c29bff4e28eea9699f79 + sha256: "8582d7f6fe14d2652b4c45c9b6c14c0b678c2af2d083a11b604caeba51930d79" url: "https://pub.dev" source: hosted - version: "6.3.9" + version: "6.3.16" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: e43b677296fadce447e987a2f519dcf5f6d1e527dc35d01ffab4fff5b8a7063e + sha256: "7f2022359d4c099eea7df3fdf739f7d3d3b9faf3166fb1dd390775176e0b76cb" url: "https://pub.dev" source: hosted - version: "6.3.1" + version: "6.3.3" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - sha256: e2b9622b4007f97f504cd64c0128309dfb978ae66adbe944125ed9e1750f06af + sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935" url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "3.2.1" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - sha256: "9a1a42d5d2d95400c795b2914c36fdcb525870c752569438e4ebb09a2b5d90de" + sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2" url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "3.2.2" url_launcher_platform_interface: dependency: transitive description: @@ -1612,18 +1612,18 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e" + sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2" url: "https://pub.dev" source: hosted - version: "2.3.3" + version: "2.4.1" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: "49c10f879746271804767cb45551ec5592cdab00ee105c06dddde1a98f73b185" + sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.4" uuid: dependency: "direct main" description: @@ -1652,10 +1652,10 @@ packages: dependency: transitive description: name: watcher - sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + sha256: "0b7fd4a0bbc4b92641dbf20adfd7e3fd1398fe17102d94b674234563e110088a" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.2" web: dependency: transitive description: @@ -1668,18 +1668,18 @@ packages: dependency: transitive description: name: web_socket - sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" url: "https://pub.dev" source: hosted - version: "0.1.6" + version: "1.0.1" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: "9f187088ed104edd8662ca07af4b124465893caf063ba29758f97af57e61da8f" + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.3" webkit_inspection_protocol: dependency: transitive description: @@ -1692,10 +1692,10 @@ packages: dependency: transitive description: name: win32 - sha256: dc6ecaa00a7c708e5b4d10ee7bec8c270e9276dfcab1783f57e9962d7884305f + sha256: "66814138c3562338d05613a6e368ed8cfb237ad6d64a9e9334be3f309acfca03" url: "https://pub.dev" source: hosted - version: "5.12.0" + version: "5.14.0" win32_registry: dependency: transitive description: @@ -1708,10 +1708,10 @@ packages: dependency: transitive description: name: xdg_directories - sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.1.0" xml: dependency: transitive description: @@ -1724,10 +1724,10 @@ packages: dependency: transitive description: name: xxh3 - sha256: a92b30944a9aeb4e3d4f3c3d4ddb3c7816ca73475cd603682c4f8149690f56d7 + sha256: "399a0438f5d426785723c99da6b16e136f4953fb1e9db0bf270bd41dd4619916" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.2.0" yaml: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 4d9d3c4a..2442d942 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,19 +14,19 @@ dependencies: archive: ^4.0.7 collection: ^1.19.1 const_date_time: ^1.2.1 - dart_helper_utils: ^5.1.0 - device_info_plus: ^11.4.0 + dart_helper_utils: ^5.2.0 + device_info_plus: ^11.5.0 dynamic_color: ^1.7.0 encrypt: ^5.0.3 equatable: ^2.0.7 flag_secure: ^2.0.2 - fleather: ^1.22.0 + fleather: ^1.24.0+1 flex_color_picker: ^3.7.1 flutter: sdk: flutter flutter_checklist: ^1.5.3 flutter_displaymode: ^0.6.0 - flutter_expandable_fab: 2.4.1 + flutter_expandable_fab: ^2.5.2 flutter_fgbg: ^0.7.1 flutter_localizations: sdk: flutter @@ -37,7 +37,7 @@ dependencies: flutter_secure_storage: ^9.2.4 flutter_staggered_grid_view: ^0.7.0 gap: ^3.0.1 - go_router: ^15.1.2 + go_router: ^16.0.0 intl: ^0.20.2 is_first_run: ^1.0.0 isar: @@ -49,9 +49,9 @@ dependencies: json_annotation: ^4.9.0 local_auth: ^2.3.0 locale_names: ^1.1.1 - logger: ^2.5.0 + logger: ^2.6.0 markdown: ^7.3.0 - material_symbols_icons: ^4.2815.0 + material_symbols_icons: ^4.2815.1 package_info_plus: ^8.3.0 parchment: any parchment_delta: any @@ -65,23 +65,23 @@ dependencies: remove_markdown: ^0.0.2 restart_app: ^1.3.2 riverpod_annotation: ^2.6.1 - saf_stream: ^0.11.2 - saf_util: ^0.8.0 + saf_stream: ^0.11.3 + saf_util: ^0.10.0 sanitize_filename: ^1.0.5 settings_tiles: ^4.1.0 share_plus: ^11.0.0 shared_preferences: ^2.5.3 simple_icons: ^14.6.1 - string_validator: ^1.1.0 + string_validator: ^1.2.0 substring_highlight: ^1.0.33 - url_launcher: ^6.3.1 + url_launcher: ^6.3.2 uuid: ^4.5.1 dev_dependencies: - build_runner: ^2.4.15 - build_verify: ^3.1.0 + build_runner: ^2.5.4 + build_verify: ^3.1.1 custom_lint: ^0.7.0 - flutter_launcher_icons: ^0.14.3 + flutter_launcher_icons: ^0.14.4 flutter_lints: ^6.0.0 isar_generator: version: ^3.1.8 From de57cb7910e4ade1f3c27b35a95b1249fa7b2c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Chiotti?= <44336112+maelchiotti@users.noreply.github.com> Date: Fri, 11 Jul 2025 16:01:31 +0200 Subject: [PATCH 6/9] [467] fix: make editor writable on new note (#477) --- lib/common/actions/notes/add.dart | 3 ++- lib/pages/editor/editor_page.dart | 21 +++++++------------ .../widgets/editors/markdown_editor.dart | 11 +--------- .../widgets/editors/plain_text_editor.dart | 11 +--------- .../widgets/editors/rich_text_editor.dart | 14 ------------- 5 files changed, 11 insertions(+), 49 deletions(-) diff --git a/lib/common/actions/notes/add.dart b/lib/common/actions/notes/add.dart index 0eaf4e25..b1322a7e 100644 --- a/lib/common/actions/notes/add.dart +++ b/lib/common/actions/notes/add.dart @@ -57,5 +57,6 @@ Future addNote(BuildContext context, WidgetRef ref, {required NoteType not } final EditorPageExtra extra = (readOnly: false, isNewNote: true); - unawaited(context.pushNamed(NavigationRoute.editor.name, extra: extra)); + + await context.pushNamed(NavigationRoute.editor.name, extra: extra); } diff --git a/lib/pages/editor/editor_page.dart b/lib/pages/editor/editor_page.dart index 6d018edf..47982197 100644 --- a/lib/pages/editor/editor_page.dart +++ b/lib/pages/editor/editor_page.dart @@ -72,39 +72,32 @@ class _EditorState extends ConsumerState { final enableLabels = PreferenceKey.enableLabels.preferenceOrDefault; final showLabelsListInEditorPage = PreferenceKey.showLabelsListInEditorPage.preferenceOrDefault; - final readOnly = widget.readOnly || (showEditorModeButton && !isEditorInEditMode); + final readOnly = (widget.readOnly && !widget.isNewNote) || (showEditorModeButton && !isEditorInEditMode); final autofocus = widget.isNewNote && !focusTitleOnNewNote; final showLabelsList = enableLabels && showLabelsListInEditorPage && currentNote.labelsVisibleSorted.isNotEmpty; + if (widget.isNewNote) { + isEditModeNotifier.value = true; + } + Widget contentEditor; Widget? toolbar; switch (currentNote) { case PlainTextNote note: - contentEditor = PlainTextEditor( - note: note, - isNewNote: widget.isNewNote, - readOnly: readOnly, - autofocus: autofocus, - ); + contentEditor = PlainTextEditor(note: note, readOnly: readOnly, autofocus: autofocus); case RichTextNote note: final fleatherController = FleatherController(document: note.document); fleatherControllerNotifier.value = fleatherController; contentEditor = RichTextEditor( note: note, fleatherController: fleatherController, - isNewNote: widget.isNewNote, readOnly: readOnly, autofocus: autofocus, ); toolbar = Toolbar(fleatherController: fleatherController); case MarkdownNote note: - contentEditor = MarkdownEditor( - note: note, - isNewNote: widget.isNewNote, - readOnly: readOnly, - autofocus: autofocus, - ); + contentEditor = MarkdownEditor(note: note, readOnly: readOnly, autofocus: autofocus); case ChecklistNote note: contentEditor = ChecklistEditor(note: note, isNewNote: widget.isNewNote, readOnly: readOnly); } diff --git a/lib/pages/editor/widgets/editors/markdown_editor.dart b/lib/pages/editor/widgets/editors/markdown_editor.dart index ccc987ae..c6762a3b 100644 --- a/lib/pages/editor/widgets/editors/markdown_editor.dart +++ b/lib/pages/editor/widgets/editors/markdown_editor.dart @@ -16,20 +16,11 @@ import '../../../../providers/notifiers/notifiers.dart'; /// Markdown editor. class MarkdownEditor extends ConsumerStatefulWidget { /// Markdown allowing to edit the markdown text content of a [MarkdownNote]. - const MarkdownEditor({ - super.key, - required this.note, - required this.isNewNote, - required this.readOnly, - required this.autofocus, - }); + const MarkdownEditor({super.key, required this.note, required this.readOnly, required this.autofocus}); /// The note to display. final MarkdownNote note; - /// Whether the note was just created. - final bool isNewNote; - /// Whether the text fields are read only. final bool readOnly; diff --git a/lib/pages/editor/widgets/editors/plain_text_editor.dart b/lib/pages/editor/widgets/editors/plain_text_editor.dart index cd144fef..76824f3a 100644 --- a/lib/pages/editor/widgets/editors/plain_text_editor.dart +++ b/lib/pages/editor/widgets/editors/plain_text_editor.dart @@ -13,20 +13,11 @@ import '../../../../providers/notifiers/notifiers.dart'; /// Plain text editor. class PlainTextEditor extends ConsumerStatefulWidget { /// Text editor allowing to edit the plain text content of a [PlainTextNote]. - const PlainTextEditor({ - super.key, - required this.note, - required this.isNewNote, - required this.readOnly, - required this.autofocus, - }); + const PlainTextEditor({super.key, required this.note, required this.readOnly, required this.autofocus}); /// The note to display. final PlainTextNote note; - /// Whether the note was just created. - final bool isNewNote; - /// Whether the text fields are read only. final bool readOnly; diff --git a/lib/pages/editor/widgets/editors/rich_text_editor.dart b/lib/pages/editor/widgets/editors/rich_text_editor.dart index 38c1681d..30b2bf63 100644 --- a/lib/pages/editor/widgets/editors/rich_text_editor.dart +++ b/lib/pages/editor/widgets/editors/rich_text_editor.dart @@ -23,7 +23,6 @@ class RichTextEditor extends ConsumerStatefulWidget { super.key, required this.fleatherController, required this.note, - required this.isNewNote, required this.readOnly, required this.autofocus, }); @@ -34,9 +33,6 @@ class RichTextEditor extends ConsumerStatefulWidget { /// The controller of the Fleather text field. final FleatherController fleatherController; - /// Whether the note was just created. - final bool isNewNote; - /// Whether the text fields are read only. final bool readOnly; @@ -48,16 +44,6 @@ class RichTextEditor extends ConsumerStatefulWidget { } class _RichTextEditorState extends ConsumerState { - @override - void initState() { - super.initState(); - - // If this is a new note, force the editing mode - if (widget.isNewNote) { - isEditModeNotifier.value = true; - } - } - void onLaunchUrl(String? url) { if (url == null) { return; From 100b16756b29b14397b6d3663a105e91547ae605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Chiotti?= <44336112+maelchiotti@users.noreply.github.com> Date: Fri, 11 Jul 2025 19:00:59 +0200 Subject: [PATCH 7/9] [469] fix: auto detect notes without a type that are not rich text (#478) --- lib/models/note/types/rich_text_note.dart | 16 ++++++++++++++++ lib/services/backup/backup_service.dart | 16 ++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/lib/models/note/types/rich_text_note.dart b/lib/models/note/types/rich_text_note.dart index c5775f5d..1a803e9c 100644 --- a/lib/models/note/types/rich_text_note.dart +++ b/lib/models/note/types/rich_text_note.dart @@ -63,6 +63,22 @@ class RichTextNote extends Note { ..title = isTitleEmpty ? '' : EncryptionUtils().encrypt(password, title) ..content = EncryptionUtils().encrypt(password, content); + /// Returns whether the [contentAsJson] is fleather data. + /// + /// If the content is encrypted the [encryptionPassword] should be provided. + static bool isFleatherData(dynamic contentAsJson, [String? encryptionPassword]) { + try { + final content = jsonDecode( + encryptionPassword != null ? EncryptionUtils().decrypt(encryptionPassword, contentAsJson) : contentAsJson, + ); + ParchmentDocument.fromJson(content); + } on Exception { + return false; + } + + return true; + } + /// Document containing the fleather content representation. @ignore ParchmentDocument get document => ParchmentDocument.fromJson(jsonDecode(content) as List); diff --git a/lib/services/backup/backup_service.dart b/lib/services/backup/backup_service.dart index 36206904..dd77171e 100644 --- a/lib/services/backup/backup_service.dart +++ b/lib/services/backup/backup_service.dart @@ -121,7 +121,14 @@ class ManualBackupService { // If the note type is null, it's an export from before v2.0.0 when only rich text notes were available if (noteType == null) { - notes.add(RichTextNote.fromJsonEncrypted(noteAsJsonEncrypted, password)); + if (RichTextNote.isFleatherData(noteAsJsonEncrypted['content'] as String, password)) { + notes.add(RichTextNote.fromJsonEncrypted(noteAsJsonEncrypted, password)); + } else { + logger.w( + 'Imported an encrypted note without a type as a plain text note because its content is not fleather data', + ); + notes.add(PlainTextNote.fromJsonEncrypted(noteAsJsonEncrypted, password)); + } } else { switch (noteType) { case NoteType.plainText: @@ -150,7 +157,12 @@ class ManualBackupService { // If the note type is null, it's an export from before v2.0.0 when only rich text notes were available if (noteType == null) { - notes.add(RichTextNote.fromJson(noteAsJson)); + if (RichTextNote.isFleatherData(noteAsJson['content'] as String)) { + notes.add(RichTextNote.fromJson(noteAsJson)); + } else { + logger.w('Imported a note without a type as a plain text note because its content is not fleather data'); + notes.add(PlainTextNote.fromJson(noteAsJson)); + } } else { switch (noteType) { case NoteType.plainText: From 6e7d3fc4ea506e097cbfbcf8ab5b21f37bdcae60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Chiotti?= <44336112+maelchiotti@users.noreply.github.com> Date: Fri, 18 Jul 2025 19:49:04 +0200 Subject: [PATCH 8/9] misc: v2.1.0 (#480) --- CHANGELOG.md | 16 + .../android/cs-CZ/full_description.yaml | 0 .../android/de-DE/full_description.yaml | 0 .../metadata/android/en-US/changelogs/290.txt | 11 + .../android/es-ES/full_description.yaml | 0 .../metadata/android/fr-FR/changelogs/290.txt | 11 + .../android/he-IL/full_description.txt | 1 + .../android/he-IL/full_description.yaml | 0 .../android/he-IL/short_description.txt | 1 + fastlane/metadata/android/he-IL/title.txt | 1 + .../android/hi-IN/full_description.yaml | 0 .../metadata/android/id/full_description.yaml | 0 .../android/it-IT/full_description.yaml | 0 .../android/pl-PL/full_description.yaml | 0 .../android/pt-PT/full_description.yaml | 0 .../android/ru-RU/full_description.txt | 2 +- .../android/ru-RU/full_description.yaml | 63 ++++ .../android/tr-TR/full_description.yaml | 0 .../android/zh-CN/full_description.yaml | 0 .../android/zh-TW/full_description.txt | 2 +- .../android/zh-TW/full_description.yaml | 64 ++++ lib/app.dart | 5 +- lib/common/enums/supported_language.dart | 6 +- lib/l10n/fallback_localization_delegate.dart | 28 ++ lib/l10n/translations/app_de.arb | 80 ++++- lib/l10n/translations/app_it.arb | 274 ++++++++++++++ lib/l10n/translations/app_ru.arb | 334 ++++++++++++++++++ lib/l10n/translations/app_zh-TW.arb | 1 - .../settings/pages/settings_about_page.dart | 47 +-- .../pages/settings_accessibility_page.dart | 31 +- .../pages/settings_appearance_page.dart | 46 ++- .../settings/pages/settings_backup_page.dart | 57 ++- .../pages/settings_behavior_page.dart | 84 +++-- .../settings/pages/settings_editor_page.dart | 21 +- .../settings/pages/settings_help_page.dart | 36 +- .../settings/pages/settings_labels_page.dart | 41 +-- .../pages/settings_notes_tiles_page.dart | 44 ++- .../pages/settings_notes_types_page.dart | 36 +- .../pages/settings_security_page.dart | 49 ++- lib/pages/settings/settings_main_page.dart | 67 ++-- lib/providers/notes/notes_provider.dart | 2 +- lib/services/notes/notes_service.dart | 4 +- pubspec.lock | 20 +- pubspec.yaml | 10 +- scripts/generate_full_description.py | 5 + 45 files changed, 1184 insertions(+), 316 deletions(-) create mode 100644 fastlane/metadata/android/cs-CZ/full_description.yaml create mode 100644 fastlane/metadata/android/de-DE/full_description.yaml create mode 100644 fastlane/metadata/android/en-US/changelogs/290.txt create mode 100644 fastlane/metadata/android/es-ES/full_description.yaml create mode 100644 fastlane/metadata/android/fr-FR/changelogs/290.txt create mode 100644 fastlane/metadata/android/he-IL/full_description.txt create mode 100644 fastlane/metadata/android/he-IL/full_description.yaml create mode 100644 fastlane/metadata/android/he-IL/short_description.txt create mode 100644 fastlane/metadata/android/he-IL/title.txt create mode 100644 fastlane/metadata/android/hi-IN/full_description.yaml create mode 100644 fastlane/metadata/android/id/full_description.yaml create mode 100644 fastlane/metadata/android/it-IT/full_description.yaml create mode 100644 fastlane/metadata/android/pl-PL/full_description.yaml create mode 100644 fastlane/metadata/android/pt-PT/full_description.yaml create mode 100644 fastlane/metadata/android/ru-RU/full_description.yaml create mode 100644 fastlane/metadata/android/tr-TR/full_description.yaml create mode 100644 fastlane/metadata/android/zh-CN/full_description.yaml create mode 100644 fastlane/metadata/android/zh-TW/full_description.yaml create mode 100644 lib/l10n/fallback_localization_delegate.dart delete mode 100644 lib/l10n/translations/app_zh-TW.arb diff --git a/CHANGELOG.md b/CHANGELOG.md index 57b87c71..f62dbd72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +# 2.1.0 - 2025-07-18 + +### Added + +- Open links in the markdown editor in read-only mode + +### Fixed + +- JSON exports missing the note type +- JSON imports failing or creating corrupted notes +- Missing localizations causing crashes +- Force the editor to be writable when adding a new note +- Undo/Redo in the rich text editor +- Links color in the rich text editor +- Empty notes not being removed + # 2.0.0 - 2025-05-18 ### Added diff --git a/fastlane/metadata/android/cs-CZ/full_description.yaml b/fastlane/metadata/android/cs-CZ/full_description.yaml new file mode 100644 index 00000000..e69de29b diff --git a/fastlane/metadata/android/de-DE/full_description.yaml b/fastlane/metadata/android/de-DE/full_description.yaml new file mode 100644 index 00000000..e69de29b diff --git a/fastlane/metadata/android/en-US/changelogs/290.txt b/fastlane/metadata/android/en-US/changelogs/290.txt new file mode 100644 index 00000000..46960aa5 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/290.txt @@ -0,0 +1,11 @@ +ADDED +- Open links in the markdown editor in read-only mode + +FIXED +- JSON exports missing the note type +- JSON imports failing or creating corrupted notes +- Missing localizations causing crashes +- Force the editor to be writable when adding a new note +- Undo/Redo in the rich text editor +- Links color in the rich text editor +- Empty notes not being removed \ No newline at end of file diff --git a/fastlane/metadata/android/es-ES/full_description.yaml b/fastlane/metadata/android/es-ES/full_description.yaml new file mode 100644 index 00000000..e69de29b diff --git a/fastlane/metadata/android/fr-FR/changelogs/290.txt b/fastlane/metadata/android/fr-FR/changelogs/290.txt new file mode 100644 index 00000000..a889359b --- /dev/null +++ b/fastlane/metadata/android/fr-FR/changelogs/290.txt @@ -0,0 +1,11 @@ +AJOUTÉ +- Ouverture des liens dans l'éditeur markdown en mode lecture seule + +CORRIGÉ +- Type de note manquant dans les exports JSON +- Imports JSON échouant ou créant des notes corrompues +- Localisations manquantes provoquant des plantages +- Forcer l'éditeur à être en écriture lors de l'ajout d'une nouvelle note +- Annuler/Rétablir dans l'éditeur de texte riche +- Couleur des liens dans l'éditeur de texte riche +- Notes vides non supprimées \ No newline at end of file diff --git a/fastlane/metadata/android/he-IL/full_description.txt b/fastlane/metadata/android/he-IL/full_description.txt new file mode 100644 index 00000000..3b077880 --- /dev/null +++ b/fastlane/metadata/android/he-IL/full_description.txt @@ -0,0 +1 @@ +

Material Notes is a text-based note-taking application, aimed at simplicity. It embraces Material Design. It stores the notes locally and doesn't have any internet permissions, so you are the only one that can access the notes.

Take notes

  • Write text notes (title and content)
  • Choose between plain text, markdown, rich text or checklist notes
  • Use the quick action from your home screen to quickly add a note

Organize

  • Search though your notes
  • Sort your notes by date or title, in ascending or descending order
  • Display your notes in a list or a grid view
  • Pin and archive your notes
  • Recover your deleted notes from the bin

Categorize

  • Categorize your notes with tags
  • Distinguish your tags with their color
  • Pin and hide your tags

Share & backup

  • Share text from other applications to add it directly to a note
  • Share your notes as text
  • Export your notes as JSON, manually or automatically, and import them back
  • Export your notes as Markdown

Protect

  • Never worry about how your data is handled: it cannot leave your device as the application doesn't have any internet permissions
  • Lock the application, a specific notes, or all notes with a specific tag
  • Encrypt your JSON exports

Customize

  • Choose your language
  • Choose your theme (light, dark or black)
  • Choose if you want your theme to be dynamic (use colors from your background)
  • Choose which notes types you want enabled
\ No newline at end of file diff --git a/fastlane/metadata/android/he-IL/full_description.yaml b/fastlane/metadata/android/he-IL/full_description.yaml new file mode 100644 index 00000000..e69de29b diff --git a/fastlane/metadata/android/he-IL/short_description.txt b/fastlane/metadata/android/he-IL/short_description.txt new file mode 100644 index 00000000..029fe64e --- /dev/null +++ b/fastlane/metadata/android/he-IL/short_description.txt @@ -0,0 +1 @@ +Simple, local, material design notes \ No newline at end of file diff --git a/fastlane/metadata/android/he-IL/title.txt b/fastlane/metadata/android/he-IL/title.txt new file mode 100644 index 00000000..7e3764fc --- /dev/null +++ b/fastlane/metadata/android/he-IL/title.txt @@ -0,0 +1 @@ +Material Notes \ No newline at end of file diff --git a/fastlane/metadata/android/hi-IN/full_description.yaml b/fastlane/metadata/android/hi-IN/full_description.yaml new file mode 100644 index 00000000..e69de29b diff --git a/fastlane/metadata/android/id/full_description.yaml b/fastlane/metadata/android/id/full_description.yaml new file mode 100644 index 00000000..e69de29b diff --git a/fastlane/metadata/android/it-IT/full_description.yaml b/fastlane/metadata/android/it-IT/full_description.yaml new file mode 100644 index 00000000..e69de29b diff --git a/fastlane/metadata/android/pl-PL/full_description.yaml b/fastlane/metadata/android/pl-PL/full_description.yaml new file mode 100644 index 00000000..e69de29b diff --git a/fastlane/metadata/android/pt-PT/full_description.yaml b/fastlane/metadata/android/pt-PT/full_description.yaml new file mode 100644 index 00000000..e69de29b diff --git a/fastlane/metadata/android/ru-RU/full_description.txt b/fastlane/metadata/android/ru-RU/full_description.txt index 3b077880..8fce4063 100644 --- a/fastlane/metadata/android/ru-RU/full_description.txt +++ b/fastlane/metadata/android/ru-RU/full_description.txt @@ -1 +1 @@ -

Material Notes is a text-based note-taking application, aimed at simplicity. It embraces Material Design. It stores the notes locally and doesn't have any internet permissions, so you are the only one that can access the notes.

Take notes

  • Write text notes (title and content)
  • Choose between plain text, markdown, rich text or checklist notes
  • Use the quick action from your home screen to quickly add a note

Organize

  • Search though your notes
  • Sort your notes by date or title, in ascending or descending order
  • Display your notes in a list or a grid view
  • Pin and archive your notes
  • Recover your deleted notes from the bin

Categorize

  • Categorize your notes with tags
  • Distinguish your tags with their color
  • Pin and hide your tags

Share & backup

  • Share text from other applications to add it directly to a note
  • Share your notes as text
  • Export your notes as JSON, manually or automatically, and import them back
  • Export your notes as Markdown

Protect

  • Never worry about how your data is handled: it cannot leave your device as the application doesn't have any internet permissions
  • Lock the application, a specific notes, or all notes with a specific tag
  • Encrypt your JSON exports

Customize

  • Choose your language
  • Choose your theme (light, dark or black)
  • Choose if you want your theme to be dynamic (use colors from your background)
  • Choose which notes types you want enabled
\ No newline at end of file +

Material Notes - это приложение для создания текстовых заметок, ориентированное на простоту. Оно поддерживает дизайн Material Design. Оно хранит заметки локально и не имеет доступа к Интернету, поэтому доступ к заметкам можете получить только вы.

Делайте заметки

  • Писать текстовые заметки (заголовок и содержание)
  • Выберите между обычным текстом, разметкой, форматированным текстом или списком заметок
  • Воспользуйтесь быстрым действием на главном экране, чтобы быстро добавить заметку

Упорядочить

  • Поиск по вашим заметкам
  • Сортировка ваших заметок по дате или названию в порядке возрастания или убывания
  • Отображение ваших заметок в виде списка или таблицы
  • Закрепите и заархивируйте свои заметки
  • Восстановите удаленные заметки из корзины

Классифицировать

  • Разделяйте свои заметки по категориям с помощью тегов
  • Выделяйте теги по цвету
  • Закрепляйте и скрывайте теги

Общий доступ и резервное копирование

  • Делитесь текстом из других приложений, чтобы добавить его непосредственно в заметку
  • Делитесь своими заметками в виде текста
  • Экспортируйте свои заметки в формате JSON вручную или автоматически и импортируйте их обратно
  • Экспортируйте свои заметки в формате Markdown

Защита

  • Никогда не беспокойтесь о том, как обрабатываются ваши данные: они не могут покинуть ваше устройство, поскольку у приложения нет прав доступа в Интернет
  • Заблокируйте приложение, определенные заметки или все заметки с определенным тегом
  • Зашифруйте свой экспорт в формате JSON

Настройка

  • Выберите свой язык
  • Выберите свою тему (светлую, темную или черную)
  • Выберите, хотите ли вы, чтобы ваша тема была динамичной (используйте цвета вашего фона)
  • Выберите, какие типы заметок вы хотите включить
\ No newline at end of file diff --git a/fastlane/metadata/android/ru-RU/full_description.yaml b/fastlane/metadata/android/ru-RU/full_description.yaml new file mode 100644 index 00000000..61b857d5 --- /dev/null +++ b/fastlane/metadata/android/ru-RU/full_description.yaml @@ -0,0 +1,63 @@ +full_description: | +

+ Material Notes - это приложение для создания текстовых заметок, ориентированное на простоту. Оно поддерживает дизайн Material Design. + Оно хранит заметки локально и не имеет доступа к Интернету, поэтому доступ к заметкам можете получить только вы. +

+ +

+ Делайте заметки +

+
    +
  • Писать текстовые заметки (заголовок и содержание)
  • +
  • Выберите между обычным текстом, разметкой, форматированным текстом или списком заметок
  • +
  • Воспользуйтесь быстрым действием на главном экране, чтобы быстро добавить заметку
  • +
+ +

+ Упорядочить +

+
    +
  • Поиск по вашим заметкам
  • +
  • Сортировка ваших заметок по дате или названию в порядке возрастания или убывания
  • +
  • Отображение ваших заметок в виде списка или таблицы
  • +
  • Закрепите и заархивируйте свои заметки
  • +
  • Восстановите удаленные заметки из корзины
  • +
+ +

+ Классифицировать +

+
    +
  • Разделяйте свои заметки по категориям с помощью тегов
  • +
  • Выделяйте теги по цвету
  • +
  • Закрепляйте и скрывайте теги
  • +
+ +

+ Общий доступ и резервное копирование +

+
    +
  • Делитесь текстом из других приложений, чтобы добавить его непосредственно в заметку
  • +
  • Делитесь своими заметками в виде текста
  • +
  • Экспортируйте свои заметки в формате JSON вручную или автоматически и импортируйте их обратно
  • +
  • Экспортируйте свои заметки в формате Markdown
  • +
+ +

+ Защита +

+
    +
  • Никогда не беспокойтесь о том, как обрабатываются ваши данные: они не могут покинуть ваше устройство, поскольку у приложения нет прав доступа в Интернет
  • +
  • Заблокируйте приложение, определенные заметки или все заметки с определенным тегом
  • +
  • Зашифруйте свой экспорт в формате JSON
  • +
+ +

+ Настройка +

+
    +
  • Выберите свой язык
  • +
  • Выберите свою тему (светлую, темную или черную)
  • +
  • Выберите, хотите ли вы, чтобы ваша тема была динамичной (используйте цвета вашего фона)
  • +
  • Выберите, какие типы заметок вы хотите включить
  • +
diff --git a/fastlane/metadata/android/tr-TR/full_description.yaml b/fastlane/metadata/android/tr-TR/full_description.yaml new file mode 100644 index 00000000..e69de29b diff --git a/fastlane/metadata/android/zh-CN/full_description.yaml b/fastlane/metadata/android/zh-CN/full_description.yaml new file mode 100644 index 00000000..e69de29b diff --git a/fastlane/metadata/android/zh-TW/full_description.txt b/fastlane/metadata/android/zh-TW/full_description.txt index 3b077880..d3455069 100644 --- a/fastlane/metadata/android/zh-TW/full_description.txt +++ b/fastlane/metadata/android/zh-TW/full_description.txt @@ -1 +1 @@ -

Material Notes is a text-based note-taking application, aimed at simplicity. It embraces Material Design. It stores the notes locally and doesn't have any internet permissions, so you are the only one that can access the notes.

Take notes

  • Write text notes (title and content)
  • Choose between plain text, markdown, rich text or checklist notes
  • Use the quick action from your home screen to quickly add a note

Organize

  • Search though your notes
  • Sort your notes by date or title, in ascending or descending order
  • Display your notes in a list or a grid view
  • Pin and archive your notes
  • Recover your deleted notes from the bin

Categorize

  • Categorize your notes with tags
  • Distinguish your tags with their color
  • Pin and hide your tags

Share & backup

  • Share text from other applications to add it directly to a note
  • Share your notes as text
  • Export your notes as JSON, manually or automatically, and import them back
  • Export your notes as Markdown

Protect

  • Never worry about how your data is handled: it cannot leave your device as the application doesn't have any internet permissions
  • Lock the application, a specific notes, or all notes with a specific tag
  • Encrypt your JSON exports

Customize

  • Choose your language
  • Choose your theme (light, dark or black)
  • Choose if you want your theme to be dynamic (use colors from your background)
  • Choose which notes types you want enabled
\ No newline at end of file +

Material Notes 乃一款以文字為本的筆記應用程式,秉承簡約之風,擁抱 Material 設計。 筆記於本機儲存,並不索取任何網際網路權限,只有您可以存取筆記。

記事

  • 撰寫文字筆記 (標題與內容)
  • 自選純文字、Markdown、格式化文字或勾選清單筆記
  • 從您的主畫面使用快速動作以便快速新增筆記

整理

  • 搜尋您的筆記
  • 按日期或標題、順序或倒序排序您的筆記
  • 以清單或網格檢視顯示您的筆記
  • 釘選與封存您的筆記
  • 從垃圾桶還原您已刪除的筆記

分類

  • 以標籤分類您的筆記
  • 以色彩區別您的標籤
  • 釘選與隱藏您的標籤

分享與備份

  • 從其他應用程式分享文字,並直接新增至筆記
  • 以文字形式分享您的筆記
  • 手動或自動將您的筆記匯出成 JSON,以便日後可重新匯入
  • 將您的筆記匯出成 Markdown

保護

  • 不必擔心您的資料如何處理:應用程式沒有任何網際網路權限, 故數據不能流出您的裝置
  • 鎖定應用程式、特定筆記又或特定標籤的所有筆記
  • 加密您的 JSON 匯出

自訂

  • 自選您的語言
  • 自選您的佈景主題 (淺色、深色或黑色)
  • 選擇是否使用動態佈景主題 (從您的背景選用色彩)
  • 自選您想啟用的筆記類型
\ No newline at end of file diff --git a/fastlane/metadata/android/zh-TW/full_description.yaml b/fastlane/metadata/android/zh-TW/full_description.yaml new file mode 100644 index 00000000..b1298db9 --- /dev/null +++ b/fastlane/metadata/android/zh-TW/full_description.yaml @@ -0,0 +1,64 @@ +full_description: | +

+ Material Notes 乃一款以文字為本的筆記應用程式,秉承簡約之風,擁抱 Material 設計。 + 筆記於本機儲存,並不索取任何網際網路權限,只有您可以存取筆記。 +

+ +

+ 記事 +

+
    +
  • 撰寫文字筆記 (標題與內容)
  • +
  • 自選純文字、Markdown、格式化文字或勾選清單筆記
  • +
  • 從您的主畫面使用快速動作以便快速新增筆記
  • +
+ +

+ 整理 +

+
    +
  • 搜尋您的筆記
  • +
  • 按日期或標題、順序或倒序排序您的筆記
  • +
  • 以清單或網格檢視顯示您的筆記
  • +
  • 釘選與封存您的筆記
  • +
  • 從垃圾桶還原您已刪除的筆記
  • +
+ +

+ 分類 +

+
    +
  • 以標籤分類您的筆記
  • +
  • 以色彩區別您的標籤
  • +
  • 釘選與隱藏您的標籤
  • +
+ +

+ 分享與備份 +

+
    +
  • 從其他應用程式分享文字,並直接新增至筆記
  • +
  • 以文字形式分享您的筆記
  • +
  • 手動或自動將您的筆記匯出成 JSON,以便日後可重新匯入
  • +
  • 將您的筆記匯出成 Markdown
  • +
+ +

+ 保護 +

+
    +
  • 不必擔心您的資料如何處理:應用程式沒有任何網際網路權限, + 故數據不能流出您的裝置
  • +
  • 鎖定應用程式、特定筆記又或特定標籤的所有筆記
  • +
  • 加密您的 JSON 匯出
  • +
+ +

+ 自訂 +

+
    +
  • 自選您的語言
  • +
  • 自選您的佈景主題 (淺色、深色或黑色)
  • +
  • 選擇是否使用動態佈景主題 (從您的背景選用色彩)
  • +
  • 自選您想啟用的筆記類型
  • +
diff --git a/lib/app.dart b/lib/app.dart index 878fbb2c..9af2a2a5 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -15,6 +15,7 @@ import 'common/preferences/preference_key.dart'; import 'common/system_utils.dart'; import 'common/ui/theme_utils.dart'; import 'l10n/app_localizations/app_localizations.g.dart'; +import 'l10n/fallback_localization_delegate.dart'; import 'navigation/router.dart'; import 'providers/labels/labels_list/labels_list_provider.dart'; import 'providers/labels/labels_navigation/labels_navigation_provider.dart'; @@ -139,8 +140,8 @@ class _AppState extends ConsumerState with AfterLayoutMixin { themeMode: themeMode, localizationsDelegates: [ ...AppLocalizations.localizationsDelegates, - ChecklistLocalizations.delegate, - FleatherLocalizations.delegate, + FallbackLocalizationDelegate(target: ChecklistLocalizations.delegate), + FallbackLocalizationDelegate(target: FleatherLocalizations.delegate), ], supportedLocales: SupportedLanguage.locales, locale: SystemUtils().appLocale, diff --git a/lib/common/enums/supported_language.dart b/lib/common/enums/supported_language.dart index 9820cd0c..600a17a2 100644 --- a/lib/common/enums/supported_language.dart +++ b/lib/common/enums/supported_language.dart @@ -17,13 +17,13 @@ enum SupportedLanguage { fr(Locale('fr'), 1), /// German. - de(Locale('de'), .79), + de(Locale('de'), .85), /// Hindi. hi(Locale('hi'), .52), /// Italian. - it(Locale('it'), .61), + it(Locale('it'), .86), /// Polish. pl(Locale('pl'), .37), @@ -32,7 +32,7 @@ enum SupportedLanguage { pt(Locale('pt'), .54), /// Russian. - ru(Locale('ru'), .61), + ru(Locale('ru'), .78), /// Turkish. tr(Locale('tr'), .48), diff --git a/lib/l10n/fallback_localization_delegate.dart b/lib/l10n/fallback_localization_delegate.dart new file mode 100644 index 00000000..3524ea42 --- /dev/null +++ b/lib/l10n/fallback_localization_delegate.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; + +/// Localization delegate with a fallback. +class FallbackLocalizationDelegate extends LocalizationsDelegate { + /// The fallback locale. + final Locale _fallbackLocale = Locale('en'); + + /// The target locale. + final LocalizationsDelegate target; + + /// Localization delegate of the [target] locale that falls back to `en` if the localizations are not available. + FallbackLocalizationDelegate({required this.target}); + + @override + bool isSupported(Locale locale) => true; + + @override + Future load(Locale locale) async { + try { + return await target.load(locale); + } catch (e) { + return await target.load(_fallbackLocale); + } + } + + @override + bool shouldReload(covariant LocalizationsDelegate old) => false; +} diff --git a/lib/l10n/translations/app_de.arb b/lib/l10n/translations/app_de.arb index d6787c6f..be5ec269 100644 --- a/lib/l10n/translations/app_de.arb +++ b/lib/l10n/translations/app_de.arb @@ -547,7 +547,7 @@ "@settings_auto_export_frequency": { "description": "Title of the settings tile to choose the frequency of the automatic exports." }, - "settings_auto_export_frequency_value": "Alle {frequency, select, 1{day} 7{week} 14{2 weeks} 30{month} other{}}", + "settings_auto_export_frequency_value": "{frequency, select, 1{Jeden Tag} 7{Jede Woche} 14{Jede 2 Wochen} 30{Jeden Monat} other{}}", "@settings_auto_export_frequency_value": { "description": "Frequency of the automatic exports.", "placeholders": { @@ -565,7 +565,7 @@ "@settings_auto_export_encryption": { "description": "Title of the settings tile to enable the encryption of the automatic exports." }, - "settings_auto_export_encryption_description": "Verschlüssele den Titel und den Inhalt er Notizen mit einem Passwort", + "settings_auto_export_encryption_description": "Verschlüssele den Titel und den Inhalt der Notizen mit einem Passwort", "@settings_auto_export_encryption_description": { "description": "Description of the settings tile to enable the encryption of the automatic exports." }, @@ -609,14 +609,36 @@ "@settings_application_lock_title": { "description": "Title of the setting tile to toggle whether the application is locked." }, + "settings_application_lock_description": "Sperre die App und Authentifizierung des Gerätes zum Entsperren anfordern", + "@settings_application_lock_description": { + "description": "Description of the setting tile to toggle whether the application is locked." + }, "settings_application_lock_delay_title": "Sperrverzögerung", "@settings_application_lock_delay_title": { "description": "Title of the setting tile to choose after which amount of time the application locks itself after it was moved to the background." }, + "settings_application_lock_delay_description": "Zeit, nach der die App gesperrt wird, nachdem sie minimiert wurde", + "@settings_application_lock_delay_description": { + "description": "Description of the setting tile to choose after which amount of time the application locks itself after it was moved to the background." + }, + "settings_lock_delay_value": "{delay, select, 0{Sofort} 3{Nach 3 Sekunden} 5{Nach 5 Sekunden} 10{Nach 10 Sekunden} 30{Nach 30 Sekunden} 60{Nach einer Minute} 120{Nach 2 Minuten} 300{} other{Nie}}", + "@settings_lock_delay_value": { + "description": "Value of the setting tile to choose after which amount of time the application/note/label locks itself after the application was moved to the background.", + "placeholders": { + "delay": { + "type": "String", + "description": "Delay in seconds." + } + } + }, "settings_note_lock_title": "Notizen Sperre", "@settings_note_lock_title": { "description": "Title of the setting tile to toggle whether the notes can be locked." }, + "settings_note_lock_description": "Sperre die Notiz und fordere eine Authentifizierung des Gerätes an, um sie zu sehen und zu bearbeiten", + "@settings_note_lock_description": { + "description": "Description of the setting tile to toggle whether the notes can be locked." + }, "settings_accessibility": "Barrierefreiheit", "@settings_accessibility": { "description": "Title of the settings page regarding the accessibility" @@ -769,6 +791,14 @@ "@settings_about_section_donate": { "description": "Title of the settings section to donate." }, + "settings_donate_kofi": "Ko-fi", + "@settings_donate_kofi": { + "description": "Title of the settings tile to donate via Ko-fi." + }, + "settings_donate_paypal": "PayPal", + "@settings_donate_paypal": { + "description": "Title of the settings tile to donate via PayPal." + }, "hint_title": "Titel", "@hint_title": { "description": "Hint for the text field of the title of the notes." @@ -981,6 +1011,10 @@ "@placeholder_labels": { "description": "Placeholder on the tags page when there are no tags." }, + "placeholder_archives": "Keine archivierten Notizen", + "@placeholder_archives": { + "description": "Placeholder on the archives notes page when there are no archived notes." + }, "placeholder_bin": "Keine gelöschten Notizen", "@placeholder_bin": { "description": "Placeholder on the bin page when there are no deleted notes." @@ -989,6 +1023,10 @@ "@action_disabled": { "description": "Swipe action that is disabled in the settings." }, + "action_pin_unpin": "Anpinnen / Pin entfernen", + "@action_pin_unpin": { + "description": "Swipe action to pin or unpin a note." + }, "action_pin": "Anheften", "@action_pin": { "description": "Swipe or menu action to pin a note." @@ -1011,6 +1049,10 @@ } } }, + "action_archive": "Archivieren", + "@action_archive": { + "description": "Swipe or menu action to archive a note (moving it to the archives)." + }, "action_delete": "Löschen", "@action_delete": { "description": "Swipe or menu action to delete a note (moving it to the bin)." @@ -1055,6 +1097,10 @@ "@about_time_at": { "description": "Preposition shown between the date and the time in the about dialog (example: 'January 5, 2024 at 5:15 PM')." }, + "action_labels_show_hide": "Zeigen / Verstecken", + "@action_labels_show_hide": { + "description": "Swipe action to show or hide a tag." + }, "action_labels_toggle_pins": "Fixierung umschalten", "@action_labels_toggle_pins": { "description": "Menu action to toggle whether the selected tags are pinned." @@ -1083,6 +1129,10 @@ "@filter_labels_pinned": { "description": "Filter chip in the tags page to show only the pinned tags." }, + "snack_bar_authentication_failed": "Die Authentifizierung ist fehlgeschlagen, bitte versuche es noch einmal.", + "@snack_bar_authentication_failed": { + "description": "Snack bar informing that the authentication on the lock screen has failed." + }, "snack_bar_archived": "Die {count, plural, one{Notiz wurde} other{Notizen wurden}} archiviert", "@snack_bar_archived": { "description": "Snack bar informing that the note was archived.", @@ -1103,6 +1153,16 @@ } } }, + "snack_bar_deleted": "Die {count, plural, one{Notiz wurde} other{Notizen wurden}} entfernt", + "@snack_bar_deleted": { + "description": "Snack bar informing that the note was deleted.", + "placeholders": { + "count": { + "description": "Number of notes that were deleted.", + "type": "int" + } + } + }, "snack_bar_import_success": "Das Backup wurde erfolgreich importiert.", "@snack_bar_import_success": { "description": "Snack bar informing that the backup was successfully imported." @@ -1142,5 +1202,21 @@ "note_type_rich_text": "Formatierter Text", "@note_type_rich_text": { "description": "Note with rich text." + }, + "rich_text_editor_toolbar_dialog_color_title_background": "Hintergrundfarbe", + "@rich_text_editor_toolbar_dialog_color_title_background": { + "description": "Title of the dialog to choose the background color of the text in the rich text editor." + }, + "rich_text_editor_toolbar_dialog_color_description": "Vordergrundfarbe", + "@rich_text_editor_toolbar_dialog_color_description": { + "description": "Description of the dialog to choose the foreground/background color of the text." + }, + "toolbar_style_one_row_simple_title": "Eine Zeile (einfache Optionen)", + "@toolbar_style_one_row_simple_title": { + "description": "Title for the style of the rich text editor toolbar with one row and only simple formatting options." + }, + "toolbar_style_one_row_simple_description": "Nur einfache Optionen in einer Zeile", + "@toolbar_style_one_row_simple_description": { + "description": "Description for the style of the rich text editor toolbar with one row and only simple formatting options." } } \ No newline at end of file diff --git a/lib/l10n/translations/app_it.arb b/lib/l10n/translations/app_it.arb index f06f1f1f..51b8a2a0 100644 --- a/lib/l10n/translations/app_it.arb +++ b/lib/l10n/translations/app_it.arb @@ -65,6 +65,10 @@ "@navigation_manage_labels_page": { "description": "Title of the page to manage the tags." }, + "navigation_archives": "Archivio", + "@navigation_archives": { + "description": "Title of the archives page." + }, "navigation_bin": "Cestino", "@navigation_bin": { "description": "Title of the bin page." @@ -77,6 +81,10 @@ "@navigation_settings_appearance": { "description": "Title of the settings page regarding the application's appearance." }, + "navigation_settings_notes_types": "Tipi di note", + "@navigation_settings_notes_types": { + "description": "Title of the settings page regarding the notes types." + }, "navigation_settings_notes_tiles": "Riquadri delle note", "@navigation_settings_notes_tiles": { "description": "Title of the settings page regarding the notes tiles appearance." @@ -97,10 +105,18 @@ "@navigation_settings_backup": { "description": "Title of the settings page regarding the backup functionality." }, + "navigation_settings_security": "Sicurezza", + "@navigation_settings_security": { + "description": "Title of the settings page regarding the security." + }, "navigation_settings_accessibility": "Accessibilità", "@navigation_settings_accessibility": { "description": "Title of the settings page regarding the accessibility." }, + "navigation_settings_help": "Aiuto", + "@navigation_settings_help": { + "description": "Title of the settings page to receive help." + }, "navigation_settings_about": "Info su", "@navigation_settings_about": { "description": "Title of the settings page regarding the information about the application." @@ -217,6 +233,14 @@ "@settings_show_separators_description": { "description": "Description of the setting tile to show the separators between the notes tiles." }, + "settings_show_note_type_icon": "Mostra icona del tipo", + "@settings_show_note_type_icon": { + "description": "Title of the setting tile to show the icon of the type of the note." + }, + "settings_show_note_type_icon_description": "Mostra l''icona del tipo della nota", + "@settings_show_note_type_icon_description": { + "description": "Description of the setting tile to show the icon of the type of the note." + }, "settings_show_titles_only": "Solo titoli", "@settings_show_titles_only": { "description": "Title of the setting tile to only show the titles of the notes in the notes tiles." @@ -245,6 +269,10 @@ "@settings_behavior": { "description": "Title of the settings page regarding the application's behavior." }, + "settings_behavior_description": "Conferme, azioni di scorrimento", + "@settings_behavior_description": { + "description": "Description of the behavior settings page." + }, "settings_behavior_application": "Applicazione", "@settings_behavior_application": { "description": "Title of the sub-section regarding the application under the behavior settings." @@ -269,10 +297,32 @@ "@settings_confirmations_title_all": { "description": "Value of the setting to always show a confirmation dialog when performing an action on a note." }, + "settings_auto_remove_from_bin_title": "Rimozione automatica", + "@settings_auto_remove_from_bin_title": { + "description": "Title of the setting tile to automatically remove notes from the bin after a certain delay." + }, + "settings_auto_remove_from_bin_description": "Rimuove automaticamente le note dal cestino", + "@settings_auto_remove_from_bin_description": { + "description": "Description of the setting tile to automatically remove notes from the bin after a certain delay." + }, + "settings_auto_remove_from_bin_value": "{delay, select, 7{Dopo 1 settimana} 14{Dopo 2 settimane} 30{Dopo 1 mese} 90{Dopo 3 mesi} 180{Dopo 6 mesi} 365{Dopo 1 anno} other{Mai}}", + "@settings_auto_remove_from_bin_value": { + "description": "Value of the setting tile to choose after which amount of time the application/note/label locks itself after the application was moved to the background.", + "placeholders": { + "delay": { + "type": "String", + "description": "Delay in days." + } + } + }, "settings_behavior_swipe_actions": "Azioni di scorrimento", "@settings_behavior_swipe_actions": { "description": "Title of the section regarding the swipe actions on the notes tiles under the behavior settings." }, + "settings_behavior_swipe_actions_archives": "Azioni di scorrimento (Archivio)", + "@settings_behavior_swipe_actions_archives": { + "description": "Title of the section regarding the swipe actions on the notes tiles in the archives under the behavior settings." + }, "settings_behavior_swipe_actions_bin": "Azioni di scorrimento (nel cestino)", "@settings_behavior_swipe_actions_bin": { "description": "Title of the section regarding the swipe actions on the notes tiles in the bin under the behavior settings." @@ -301,10 +351,42 @@ "@settings_bin_swipe_action_left_description": { "description": "Description of the setting tile to choose which action to trigger when a left swipe is performed on a note tile in the bin." }, + "settings_page_notes_types": "Tipi di note", + "@settings_page_notes_types": { + "description": "Title of the settings page regarding the notes types." + }, + "settings_page_notes_types_description": "Tipi da utilizzare, testo avanzato", + "@settings_page_notes_types_description": { + "description": "Description of the settings page regarding the notes types." + }, + "settings_section_types_to_use": "Tipi da utilizzare", + "@settings_section_types_to_use": { + "description": "Title of the settings section regarding the notes types to use." + }, + "settings_available_notes_types": "Tipi di note disponibili", + "@settings_available_notes_types": { + "description": "Title of the setting tile to choose the available notes types." + }, + "settings_available_notes_types_description": "La lista di tipi di note che posso essere creati con il pulsante \"+\" dalla pagina delle note. Quando rimuovi un tipo, le note esistenti di quel tipo non saranno rimosse e rimarranno utilizzabili", + "@settings_available_notes_types_description": { + "description": "Description of the setting tile to choose the available notes types." + }, + "settings_available_default_share_type": "Tipo da condivisione", + "@settings_available_default_share_type": { + "description": "Title of the setting tile to choose the default note type to use when creating a note from a share action." + }, + "settings_available_default_share_type_description": "Il tipo predefinito di nota da utilizzare quando si crea una nota da una condivisione. Può essere un tipo non disponibile dal tasto \"+\"", + "@settings_available_default_share_type_description": { + "description": "Description of the setting tile to choose the default note type to use when creating a note from a share action." + }, "settings_editor": "Editor", "@settings_editor": { "description": "Title of the settings page regarding the notes content editor." }, + "settings_editor_description": "Comportamenti", + "@settings_editor_description": { + "description": "Description of the editor settings page." + }, "settings_editor_behavior": "Comportamenti", "@settings_editor_behavior": { "description": "Title of the settings section regarding the behavior of the editor" @@ -337,6 +419,14 @@ "@settings_editor_appearance": { "description": "Title of the settings section regarding the appearance of the editor" }, + "settings_toolbar_style_title": "Stile barra degli strumenti", + "@settings_toolbar_style_title": { + "description": "Title of the setting tile to choose the toolbar style." + }, + "settings_toolbar_style_description": "Stile della barra degli strumenti dell''editor di testo avanzato", + "@settings_toolbar_style_description": { + "description": "Description of the setting tile to choose the toolbar style." + }, "settings_use_paragraph_spacing": "Spaziatura dei paragrafi", "@settings_use_paragraph_spacing": { "description": "Title of the setting tile to enable the spacing between paragraphs in the notes content." @@ -381,6 +471,26 @@ "@settings_show_labels_editor_description": { "description": "Description of the setting tile to show the tags in the editor." }, + "settings_labels_section_behavior": "Comportamento", + "@settings_labels_section_behavior": { + "description": "Title of the settings section regarding the behavior of the tags." + }, + "settings_labels_swipe_action_right": "Azione di scorrimento a destra", + "@settings_labels_swipe_action_right": { + "description": "Title of the setting tile to choose which action to trigger when a right swapping a label tile." + }, + "settings_labels_swipe_action_right_description": "Azione che viene eseguita dopo uno scorrimento verso destra su una nota", + "@settings_labels_swipe_action_right_description": { + "description": "Description of the setting tile to choose which action to trigger when a right swipe is performed on a label tile." + }, + "settings_labels_swipe_action_left": "Azione di scorrimento a sinistra", + "@settings_labels_swipe_action_left": { + "description": "Title of the setting tile to choose which action to trigger when a left swapping a label tile." + }, + "settings_labels_swipe_action_left_description": "Azione che viene eseguita dopo uno scorrimento verso sinistra su una nota", + "@settings_labels_swipe_action_left_description": { + "description": "Description of the setting tile to choose which action to trigger when a left swipe is performed on a label tile." + }, "settings_backup": "Backup", "@settings_backup": { "description": "Title of the settings page regarding the backup functionality." @@ -409,10 +519,18 @@ "@settings_export_json": { "description": "Title of the setting tile to manually export the notes as JSON." }, + "settings_export_json_description": "Esposta immediatamente tutte le note, le etichette e le impostazioni in un file JSON che può essere importato nuovamente", + "@settings_export_json_description": { + "description": "Description of the setting tile to manually export the notes as JSON." + }, "settings_export_markdown": "Esporta come Markdown", "@settings_export_markdown": { "description": "Title of the setting tile to manually export the notes as Markdown." }, + "settings_export_markdown_description": "Esporta immediatamente tutte le note in un file Markdown", + "@settings_export_markdown_description": { + "description": "Description of the setting tile to manually export the notes as Markdown." + }, "settings_backup_auto_export": "Esportazione automatica", "@settings_backup_auto_export": { "description": "Title of the settings section regarding the automatic export of the notes." @@ -421,10 +539,24 @@ "@settings_auto_export": { "description": "Title of the settings tile to enable the automatic export of the notes." }, + "settings_auto_export_description": "Esposta automaticamente tutte le note, le etichette e le impostazioni in un file JSON che può essere importato nuovamente", + "@settings_auto_export_description": { + "description": "Description of the settings tile to enable the automatic export." + }, "settings_auto_export_frequency": "Frequenza", "@settings_auto_export_frequency": { "description": "Title of the settings tile to choose the frequency of the automatic exports." }, + "settings_auto_export_frequency_value": "Ogni {frequency, select, 1{giorno} 7{settimana} 14{2 settimane} 30{mese} other{}}", + "@settings_auto_export_frequency_value": { + "description": "Frequency of the automatic exports.", + "placeholders": { + "frequency": { + "description": "Frequency in days.", + "type": "String" + } + } + }, "settings_auto_export_frequency_description": "Frequenza delle esportazioni automatiche", "@settings_auto_export_frequency_description": { "description": "Description of the settings tile to choose the frequency of the automatic exports of the notes." @@ -445,6 +577,26 @@ "@settings_auto_export_directory_description": { "description": "Description of the settings tile to choose the directory where to save the automatic exports." }, + "settings_security": "Sicurezza", + "@settings_security": { + "description": "Title of the settings page regarding the security." + }, + "settings_security_description": "Contrassegno sicurezza, blocco applicazione, blocco note", + "@settings_security_description": { + "description": "Description of the settings page regarding the security." + }, + "settings_security_application": "Applicazione", + "@settings_security_application": { + "description": "Title of the sub-section regarding the application under the security settings." + }, + "settings_security_application_lock": "Blocca applicazione", + "@settings_security_application_lock": { + "description": "Title of the sub-section regarding the application lock under the security settings." + }, + "settings_security_note_lock": "Blocca note", + "@settings_security_note_lock": { + "description": "Title of the sub-section regarding the note lock under the security settings." + }, "settings_flag_secure": "Contrassegna l''applicazione come sicura", "@settings_flag_secure": { "description": "Title of the setting tile to flag the application as secure (hiding it from the recent apps and prevent screenshots from being made)." @@ -453,6 +605,44 @@ "@settings_flag_secure_description": { "description": "Description of the setting tile to flag the application as secure (hiding it from the recent apps and prevent screenshots from being made)." }, + "settings_application_lock_title": "Blocca", + "@settings_application_lock_title": { + "description": "Title of the setting tile to toggle whether the application is locked." + }, + "settings_application_lock_description": "Blocca l'applicazione e richiedi l'autenticazione sul dispositivo per lo sblocco", + "@settings_application_lock_description": { + "description": "Description of the setting tile to toggle whether the application is locked." + }, + "settings_application_lock_delay_title": "Ritardo di blocco", + "@settings_application_lock_delay_title": { + "description": "Title of the setting tile to choose after which amount of time the application locks itself after it was moved to the background." + }, + "settings_application_lock_delay_description": "Tempo dopo il quale l''applicazione si blocca una volta messa in secondo piano", + "@settings_application_lock_delay_description": { + "description": "Description of the setting tile to choose after which amount of time the application locks itself after it was moved to the background." + }, + "settings_lock_delay_value": "{delay, select, 0{Immediatamente} 3{Dopo 3 secondi} 5{Dopo 5 secondi} 10{Dopo 10 secondi} 30{Dopo 30 secondi} 60{Dopo 1 minuto} 120{Dopo 2 minuti} 300{Dopo 5 minuti} other{Mai}}", + "@settings_lock_delay_value": { + "description": "Value of the setting tile to choose after which amount of time the application/note/label locks itself after the application was moved to the background.", + "placeholders": { + "delay": { + "type": "String", + "description": "Delay in seconds." + } + } + }, + "settings_note_lock_title": "Blocca le note", + "@settings_note_lock_title": { + "description": "Title of the setting tile to toggle whether the notes can be locked." + }, + "settings_note_lock_description": "Blocca le note e richiedi l''autenticazione sul dispositivo per visualizzarle e modificarle", + "@settings_note_lock_description": { + "description": "Description of the setting tile to toggle whether the notes can be locked." + }, + "settings_label_lock_title": "Blocca le etichette", + "@settings_label_lock_title": { + "description": "Title of the setting tile to toggle whether the tags can be locked." + }, "settings_accessibility": "Accessibilità", "@settings_accessibility": { "description": "Title of the settings page regarding the accessibility" @@ -613,6 +803,18 @@ "@tooltip_fab_add_note": { "description": "Floating action button in the notes page to add a new note." }, + "tooltip_fab_add_plain_text_note": "Aggiungi una nota in testo semplice", + "@tooltip_fab_add_plain_text_note": { + "description": "Floating action button in the notes page to add a new plain text note." + }, + "tooltip_fab_add_markdown_note": "Aggiungi una nota in Markdown", + "@tooltip_fab_add_markdown_note": { + "description": "Floating action button in the notes page to add a new markdown note." + }, + "tooltip_fab_add_rich_text_note": "Aggiungi una nota in testo avanzato", + "@tooltip_fab_add_rich_text_note": { + "description": "Floating action button in the notes page to add a new rich text note." + }, "tooltip_fab_add_label": "Aggiungi un''etichetta", "@tooltip_fab_add_label": { "description": "Floating action button in the tags page to add a new tag." @@ -657,6 +859,34 @@ "@dialog_add_link": { "description": "Tooltip for the button to validate the dialog to add a link in the note editor." }, + "dialog_archive": "Archivio", + "@dialog_archive": { + "description": "Title of the the dialog to archive one or multiple notes (moving them to the archives), and text for the confirmation button." + }, + "dialog_archive_body": "Vuoi davvero archiviare {count} {count, plural, one{nota} other{note}}?", + "@dialog_archive_body": { + "description": "Text for the dialog to confirm the archival of one or multiple notes.", + "placeholders": { + "count": { + "description": "Number of notes to archive.", + "type": "int" + } + } + }, + "dialog_unarchive": "Ripristina", + "@dialog_unarchive": { + "description": "Title of the the dialog to unarchive one or multiple notes, and text for the confirmation button." + }, + "dialog_unarchive_body": "Vuoi davvero ripristinare {count} {count, plural, one{nota} other{note}}?", + "@dialog_unarchive_body": { + "description": "Text for the dialog to confirm the unarchival of one or multiple notes.", + "placeholders": { + "count": { + "description": "Number of notes to unarchive.", + "type": "int" + } + } + }, "dialog_delete": "Elimina", "@dialog_delete": { "description": "Title of the the dialog to delete one or multiple notes (moving them to the bin), and text for the confirmation button." @@ -781,6 +1011,10 @@ "@placeholder_labels": { "description": "Placeholder on the tags page when there are no tags." }, + "placeholder_archives": "Nessuna nota archiviata", + "@placeholder_archives": { + "description": "Placeholder on the archives notes page when there are no archived notes." + }, "placeholder_bin": "Nessuna nota eliminata", "@placeholder_bin": { "description": "Placeholder on the bin page when there are no deleted notes." @@ -883,6 +1117,46 @@ "@filter_labels_pinned": { "description": "Filter chip in the tags page to show only the pinned tags." }, + "snack_bar_archived": "{count, plural, one{La nota è stata archiviata} other{Le note sono state archiviate}}", + "@snack_bar_archived": { + "description": "Snack bar informing that the note was archived.", + "placeholders": { + "count": { + "description": "Number of notes that were archived.", + "type": "int" + } + } + }, + "snack_bar_unarchived": "{count, plural, one{La nota è stata ripristinata} other{Le note sono state ripristinate}}", + "@snack_bar_unarchived": { + "description": "Snack bar informing that the note was unarchived.", + "placeholders": { + "count": { + "description": "Number of notes that were unarchived.", + "type": "int" + } + } + }, + "snack_bar_deleted": "{count, plural, one{La nota è stata cancellate} other{Le note sono state cancellate}}", + "@snack_bar_deleted": { + "description": "Snack bar informing that the note was deleted.", + "placeholders": { + "count": { + "description": "Number of notes that were deleted.", + "type": "int" + } + } + }, + "snack_bar_restored": "{count, plural, one{La nota è stata ripristinata} other{Le note sono state ripristinate}}", + "@snack_bar_restored": { + "description": "Snack bar informing that the note was restored.", + "placeholders": { + "count": { + "description": "Number of notes that were restored.", + "type": "int" + } + } + }, "snack_bar_import_success": "Il backup è stato importato con successo.", "@snack_bar_import_success": { "description": "Snack bar informing that the backup was successfully imported." diff --git a/lib/l10n/translations/app_ru.arb b/lib/l10n/translations/app_ru.arb index e446c9c5..46e9c3c1 100644 --- a/lib/l10n/translations/app_ru.arb +++ b/lib/l10n/translations/app_ru.arb @@ -65,6 +65,10 @@ "@navigation_manage_labels_page": { "description": "Title of the page to manage the tags." }, + "navigation_archives": "Архив", + "@navigation_archives": { + "description": "Title of the archives page." + }, "navigation_bin": "Корзина", "@navigation_bin": { "description": "Title of the bin page." @@ -77,6 +81,10 @@ "@navigation_settings_appearance": { "description": "Title of the settings page regarding the application's appearance." }, + "navigation_settings_notes_types": "Тип заметки", + "@navigation_settings_notes_types": { + "description": "Title of the settings page regarding the notes types." + }, "navigation_settings_notes_tiles": "Плитки заметок", "@navigation_settings_notes_tiles": { "description": "Title of the settings page regarding the notes tiles appearance." @@ -97,10 +105,18 @@ "@navigation_settings_backup": { "description": "Title of the settings page regarding the backup functionality." }, + "navigation_settings_security": "Безопасность", + "@navigation_settings_security": { + "description": "Title of the settings page regarding the security." + }, "navigation_settings_accessibility": "Специальные возможности", "@navigation_settings_accessibility": { "description": "Title of the settings page regarding the accessibility." }, + "navigation_settings_help": "Помощь", + "@navigation_settings_help": { + "description": "Title of the settings page to receive help." + }, "navigation_settings_about": "О приложении", "@navigation_settings_about": { "description": "Title of the settings page regarding the information about the application." @@ -217,6 +233,14 @@ "@settings_show_separators_description": { "description": "Description of the setting tile to show the separators between the notes tiles." }, + "settings_show_note_type_icon": "Показать тип значка", + "@settings_show_note_type_icon": { + "description": "Title of the setting tile to show the icon of the type of the note." + }, + "settings_show_note_type_icon_description": "Показать иконку типа заметки", + "@settings_show_note_type_icon_description": { + "description": "Description of the setting tile to show the icon of the type of the note." + }, "settings_show_titles_only": "Только заголовки", "@settings_show_titles_only": { "description": "Title of the setting tile to only show the titles of the notes in the notes tiles." @@ -245,6 +269,10 @@ "@settings_behavior": { "description": "Title of the settings page regarding the application's behavior." }, + "settings_behavior_description": "Подтверждать действия свайпом", + "@settings_behavior_description": { + "description": "Description of the behavior settings page." + }, "settings_behavior_application": "Приложение", "@settings_behavior_application": { "description": "Title of the sub-section regarding the application under the behavior settings." @@ -269,10 +297,32 @@ "@settings_confirmations_title_all": { "description": "Value of the setting to always show a confirmation dialog when performing an action on a note." }, + "settings_auto_remove_from_bin_title": "Авто удаление из корзины", + "@settings_auto_remove_from_bin_title": { + "description": "Title of the setting tile to automatically remove notes from the bin after a certain delay." + }, + "settings_auto_remove_from_bin_description": "Авто удаление из корзины", + "@settings_auto_remove_from_bin_description": { + "description": "Description of the setting tile to automatically remove notes from the bin after a certain delay." + }, + "settings_auto_remove_from_bin_value": "{delay, select, 7{Через 1 неделю} 14{Через 2 недели} 30{Через 1 месяц} 90{Через 3 месяца} 180{Через 6 месяцев} 365{Через 1 год} other{Никогда}}", + "@settings_auto_remove_from_bin_value": { + "description": "Value of the setting tile to choose after which amount of time the application/note/label locks itself after the application was moved to the background.", + "placeholders": { + "delay": { + "type": "String", + "description": "Delay in days." + } + } + }, "settings_behavior_swipe_actions": "Действия при свайпе", "@settings_behavior_swipe_actions": { "description": "Title of the section regarding the swipe actions on the notes tiles under the behavior settings." }, + "settings_behavior_swipe_actions_archives": "Действие свайпа (архив)", + "@settings_behavior_swipe_actions_archives": { + "description": "Title of the section regarding the swipe actions on the notes tiles in the archives under the behavior settings." + }, "settings_behavior_swipe_actions_bin": "Действия при свайпе (в корзине)", "@settings_behavior_swipe_actions_bin": { "description": "Title of the section regarding the swipe actions on the notes tiles in the bin under the behavior settings." @@ -301,10 +351,42 @@ "@settings_bin_swipe_action_left_description": { "description": "Description of the setting tile to choose which action to trigger when a left swipe is performed on a note tile in the bin." }, + "settings_page_notes_types": "Типы заметок", + "@settings_page_notes_types": { + "description": "Title of the settings page regarding the notes types." + }, + "settings_page_notes_types_description": "Типы форматирования текста", + "@settings_page_notes_types_description": { + "description": "Description of the settings page regarding the notes types." + }, + "settings_section_types_to_use": "Тип для использования", + "@settings_section_types_to_use": { + "description": "Title of the settings section regarding the notes types to use." + }, + "settings_available_notes_types": "Доступные типы заметок", + "@settings_available_notes_types": { + "description": "Title of the setting tile to choose the available notes types." + }, + "settings_available_notes_types_description": "Список типов заметок, которые можно создать с помощью кнопки «Добавить» на странице заметок. При удалении типа уже существующие заметки с этим типом не удаляются и могут быть использованы в обычном режиме", + "@settings_available_notes_types_description": { + "description": "Description of the setting tile to choose the available notes types." + }, + "settings_available_default_share_type": "Общий ресурс по умолчанию", + "@settings_available_default_share_type": { + "description": "Title of the setting tile to choose the default note type to use when creating a note from a share action." + }, + "settings_available_default_share_type_description": "Тип заметки по умолчанию, используемый при создании заметки из действия «Поделиться». Это может быть тип, недоступный из кнопки «Добавить»", + "@settings_available_default_share_type_description": { + "description": "Description of the setting tile to choose the default note type to use when creating a note from a share action." + }, "settings_editor": "Редактор", "@settings_editor": { "description": "Title of the settings page regarding the notes content editor." }, + "settings_editor_description": "Поведение", + "@settings_editor_description": { + "description": "Description of the editor settings page." + }, "settings_editor_behavior": "Поведение", "@settings_editor_behavior": { "description": "Title of the settings section regarding the behavior of the editor" @@ -337,6 +419,14 @@ "@settings_editor_appearance": { "description": "Title of the settings section regarding the appearance of the editor" }, + "settings_toolbar_style_title": "Стиль панели инструментов", + "@settings_toolbar_style_title": { + "description": "Title of the setting tile to choose the toolbar style." + }, + "settings_toolbar_style_description": "Стиль панели инструментов редактора форматированного текста", + "@settings_toolbar_style_description": { + "description": "Description of the setting tile to choose the toolbar style." + }, "settings_use_paragraph_spacing": "Расстояние между абзацами", "@settings_use_paragraph_spacing": { "description": "Title of the setting tile to enable the spacing between paragraphs in the notes content." @@ -381,6 +471,18 @@ "@settings_show_labels_editor_description": { "description": "Description of the setting tile to show the tags in the editor." }, + "settings_labels_section_behavior": "Поведение", + "@settings_labels_section_behavior": { + "description": "Title of the settings section regarding the behavior of the tags." + }, + "settings_labels_swipe_action_right": "Действие при смахивании вправо", + "@settings_labels_swipe_action_right": { + "description": "Title of the setting tile to choose which action to trigger when a right swapping a label tile." + }, + "settings_labels_swipe_action_left": "Действие при смахивании влево", + "@settings_labels_swipe_action_left": { + "description": "Title of the setting tile to choose which action to trigger when a left swapping a label tile." + }, "settings_backup": "Резервное копирование", "@settings_backup": { "description": "Title of the settings page regarding the backup functionality." @@ -445,6 +547,22 @@ "@settings_auto_export_directory_description": { "description": "Description of the settings tile to choose the directory where to save the automatic exports." }, + "settings_security": "Безопасность", + "@settings_security": { + "description": "Title of the settings page regarding the security." + }, + "settings_security_application": "Приложение", + "@settings_security_application": { + "description": "Title of the sub-section regarding the application under the security settings." + }, + "settings_security_application_lock": "Блокировка приложения", + "@settings_security_application_lock": { + "description": "Title of the sub-section regarding the application lock under the security settings." + }, + "settings_security_note_lock": "Блокировка заметки", + "@settings_security_note_lock": { + "description": "Title of the sub-section regarding the note lock under the security settings." + }, "settings_flag_secure": "Помечать приложение как защищённое", "@settings_flag_secure": { "description": "Title of the setting tile to flag the application as secure (hiding it from the recent apps and prevent screenshots from being made)." @@ -453,6 +571,14 @@ "@settings_flag_secure_description": { "description": "Description of the setting tile to flag the application as secure (hiding it from the recent apps and prevent screenshots from being made)." }, + "settings_application_lock_title": "Блокировать", + "@settings_application_lock_title": { + "description": "Title of the setting tile to toggle whether the application is locked." + }, + "settings_application_lock_delay_title": "Задержка блокировки", + "@settings_application_lock_delay_title": { + "description": "Title of the setting tile to choose after which amount of time the application locks itself after it was moved to the background." + }, "settings_accessibility": "Специальные возможности", "@settings_accessibility": { "description": "Title of the settings page regarding the accessibility" @@ -493,6 +619,10 @@ "@settings_disable_subdued_note_content_preview_description": { "description": "Description of the setting tile to disable the subdued color of the notes content preview text in the notes tiles." }, + "settings_help_section_contact": "Обратная связь", + "@settings_help_section_contact": { + "description": "Title of the settings section regarding how to get in contact." + }, "settings_github_issues": "Сообщить об ошибке или запросить функцию", "@settings_github_issues": { "description": "Title of the settings tile to open the GitHub issues and report a bug or request a feature." @@ -509,10 +639,22 @@ "@settings_github_discussions_description": { "description": "Description of the settings tile to open the GitHub discussions and ask a question." }, + "settings_contact_developer": "Связаться с разработчиком", + "@settings_contact_developer": { + "description": "Title of the settings tile to contact the developer via mail." + }, "settings_get_in_touch_description": "Свяжитесь с разработчиком по почте {email}", "@settings_get_in_touch_description": { "description": "Description of the settings tile to contact the developer via mail." }, + "settings_help": "Помощь", + "@settings_help": { + "description": "Title of the settings page to receive help." + }, + "settings_help_section_logs": "Журналы", + "@settings_help_section_logs": { + "description": "Title of the settings section regarding the logs of the application." + }, "settings_copy_logs": "Скопировать журналы", "@settings_copy_logs": { "description": "Title of the settings tile to copy the logs of the application to the clipboard." @@ -577,10 +719,26 @@ "@settings_licence_description": { "description": "Description of the settings tile to open the license of the application." }, + "settings_about_section_donate": "Отдарить", + "@settings_about_section_donate": { + "description": "Title of the settings section to donate." + }, + "settings_donate_kofi": "Ko-fi", + "@settings_donate_kofi": { + "description": "Title of the settings tile to donate via Ko-fi." + }, + "settings_donate_paypal": "PayPal", + "@settings_donate_paypal": { + "description": "Title of the settings tile to donate via PayPal." + }, "hint_title": "Заголовок", "@hint_title": { "description": "Hint for the text field of the title of the notes." }, + "hint_content": "Заметка", + "@hint_content": { + "description": "Hint for the text field of the content of the notes." + }, "hint_link": "Ссылка", "@hint_link": { "description": "Hint for the link text field in the dialog to add a link in the editor." @@ -613,6 +771,18 @@ "@tooltip_fab_add_note": { "description": "Floating action button in the notes page to add a new note." }, + "tooltip_fab_add_markdown_note": "Добавить Markdown заметку", + "@tooltip_fab_add_markdown_note": { + "description": "Floating action button in the notes page to add a new markdown note." + }, + "tooltip_fab_add_rich_text_note": "Добавить текстовую заметку", + "@tooltip_fab_add_rich_text_note": { + "description": "Floating action button in the notes page to add a new rich text note." + }, + "tooltip_fab_add_checklist_note": "Добавить контрольный список", + "@tooltip_fab_add_checklist_note": { + "description": "Floating action button in the notes page to add a new checklist note." + }, "tooltip_fab_add_label": "Добавить новый тег", "@tooltip_fab_add_label": { "description": "Floating action button in the tags page to add a new tag." @@ -657,6 +827,14 @@ "@dialog_add_link": { "description": "Tooltip for the button to validate the dialog to add a link in the note editor." }, + "dialog_archive": "Архивирование", + "@dialog_archive": { + "description": "Title of the the dialog to archive one or multiple notes (moving them to the archives), and text for the confirmation button." + }, + "dialog_unarchive": "Разархивировать", + "@dialog_unarchive": { + "description": "Title of the the dialog to unarchive one or multiple notes, and text for the confirmation button." + }, "dialog_delete": "Удалить", "@dialog_delete": { "description": "Title of the the dialog to delete one or multiple notes (moving them to the bin), and text for the confirmation button." @@ -789,6 +967,10 @@ "@action_disabled": { "description": "Swipe action that is disabled in the settings." }, + "action_pin_unpin": "Закрепить / Открепить", + "@action_pin_unpin": { + "description": "Swipe action to pin or unpin a note." + }, "action_pin": "Закрепить", "@action_pin": { "description": "Swipe or menu action to pin a note." @@ -797,6 +979,22 @@ "@action_unpin": { "description": "Swipe or menu action to unpin a note." }, + "action_toggle_lock": "Переключить блокировку", + "@action_toggle_lock": { + "description": "Menu action to toggle whether the notes are locked." + }, + "action_lock_unlock": "Блокировать / Разблокировать", + "@action_lock_unlock": { + "description": "Swipe action to lock or unlock a note." + }, + "action_lock": "Блокировать", + "@action_lock": { + "description": "Swipe or menu action to lock a note." + }, + "action_unlock": "Разблокировать", + "@action_unlock": { + "description": "Swipe or menu action to unlock a note." + }, "action_share": "Поделиться", "@action_share": { "description": "Swipe or menu action to share a note." @@ -811,6 +1009,14 @@ } } }, + "action_archive": "Архивировать", + "@action_archive": { + "description": "Swipe or menu action to archive a note (moving it to the archives)." + }, + "action_unarchive": "Разархивировать", + "@action_unarchive": { + "description": "Swipe or menu action to unarchive a note." + }, "action_delete": "Удалить", "@action_delete": { "description": "Swipe or menu action to delete a note (moving it to the bin)." @@ -855,10 +1061,62 @@ "@about_time_at": { "description": "Preposition shown between the date and the time in the about dialog (example: 'January 5, 2024 at 5:15 PM')." }, + "menu_action_select_labels": "Теги", + "@menu_action_select_labels": { + "description": "Menu action to select the tags of a note." + }, + "menu_action_add_labels": "Добавить теги", + "@menu_action_add_labels": { + "description": "Menu action to add tags to multiple notes." + }, + "action_labels_toggle_visibile": "Переключить видимость", + "@action_labels_toggle_visibile": { + "description": "Tooltip for the button to toggle whether the selected tags are visible." + }, + "action_labels_show_hide": "Показать / Скрыть", + "@action_labels_show_hide": { + "description": "Swipe action to show or hide a tag." + }, + "action_labels_show": "Показать", + "@action_labels_show": { + "description": "Menu or swipe action to make tag visible." + }, + "action_labels_hide": "Скрыть", + "@action_labels_hide": { + "description": "Menu or swipe action to hide a tag." + }, "action_labels_toggle_pins": "Закрепить/Открепить", "@action_labels_toggle_pins": { "description": "Menu action to toggle whether the selected tags are pinned." }, + "action_labels_pin_unpin": "Закрепить / Открепить", + "@action_labels_pin_unpin": { + "description": "Swipe action to pin or unpin a tag." + }, + "action_labels_pin": "Закрепить", + "@action_labels_pin": { + "description": "Menu or swipe action to pin a tag." + }, + "action_labels_unpin": "Открепить", + "@action_labels_unpin": { + "description": "Menu or swipe action to unpin a tag." + }, + "action_labels_toggle_lock": "Переключить блокировку", + "@action_labels_toggle_lock": { + "description": "Tooltip for the button to toggle whether the selected tags are locked." + }, + "action_labels_lock_unlock": "Блокировать / Разблокировать", + "@action_labels_lock_unlock": { + "description": "Swipe action to lock or unlock a tag." + }, + "action_labels_lock": "Блокировать", + "@action_labels_lock": { + "description": "Menu or swipe action to lock a tag." + }, + "action_labels_unlock": "Разблокировать", + "@action_labels_unlock": { + "description": "Menu or swipe action to unlock a tag." + }, "action_labels_edit": "Редактировать", "@action_labels_edit": { "description": "Menu or swipe action to edit a tag." @@ -883,6 +1141,14 @@ "@filter_labels_pinned": { "description": "Filter chip in the tags page to show only the pinned tags." }, + "filter_labels_locked": "Заблокирован", + "@filter_labels_locked": { + "description": "Filter chip in the tags page to show only the locked tags." + }, + "snack_bar_authentication_failed": "Аутентификация не удалась, пожалуйста попробуйте сново.", + "@snack_bar_authentication_failed": { + "description": "Snack bar informing that the authentication on the lock screen has failed." + }, "snack_bar_import_success": "Резервная копия была успешно импортирована.", "@snack_bar_import_success": { "description": "Snack bar informing that the backup was successfully imported." @@ -903,6 +1169,18 @@ "@snack_bar_no_labels": { "description": "Snack bar message shown when the user tries to select the tags for a note, but there are no tags available." }, + "quick_action_add_plain_text_note_title": "Добавить простую текстовую заметку", + "@quick_action_add_plain_text_note_title": { + "description": "Title of the home screen action to add a new plain text note." + }, + "quick_action_add_markdown_note_title": "Добавить Markdown заметку", + "@quick_action_add_markdown_note_title": { + "description": "Title of the home screen action to add a new markdown note." + }, + "quick_action_add_checklist_note_title": "Добавить контрольный список", + "@quick_action_add_checklist_note_title": { + "description": "Title of the home screen action to add a new checklist note." + }, "welcome_note_title": "Добро пожаловать в Material Notes!", "@welcome_note_title": { "description": "Title of the welcome note automatically created on the first run of the application." @@ -919,8 +1197,64 @@ "@note_type_plain_text": { "description": "Note with plain text." }, + "note_type_markdown": "Markdown", + "@note_type_markdown": { + "description": "Note with markdown text." + }, "note_type_rich_text": "Rich text", "@note_type_rich_text": { "description": "Note with rich text." + }, + "note_type_checklist": "Контрольный список", + "@note_type_checklist": { + "description": "Note with a checklist." + }, + "lock_page_reason_app": "Разблокировать Material Notes", + "@lock_page_reason_app": { + "description": "Reason for the lock screen of the application to request a system authentication." + }, + "lock_page_reason_note": "Разблокировать эту заметку", + "@lock_page_reason_note": { + "description": "Reason for the lock screen of a locked note to request a system authentication." + }, + "lock_page_reason_action": "Авторизовать это действие", + "@lock_page_reason_action": { + "description": "Reason for the lock screen for a secure action to request a system authentication." + }, + "lock_page_description_app": "Приложение заблокировано.", + "@lock_page_description_app": { + "description": "Description shown in the lock page for the application." + }, + "lock_page_description_note": "Эта заметка заблокирована.", + "@lock_page_description_note": { + "description": "Description shown in the lock page for a locked note." + }, + "lock_page_unlock": "Разблокировать", + "@lock_page_unlock": { + "description": "Button to unlock the lock page by requesting a system authentication." + }, + "rich_text_editor_toolbar_dialog_color_title_foreground": "Основной цвет", + "@rich_text_editor_toolbar_dialog_color_title_foreground": { + "description": "Title of the dialog to choose the foreground color of the text in the rich text editor." + }, + "rich_text_editor_toolbar_dialog_color_title_background": "Цвет фона", + "@rich_text_editor_toolbar_dialog_color_title_background": { + "description": "Title of the dialog to choose the background color of the text in the rich text editor." + }, + "rich_text_editor_toolbar_dialog_color_description": "Основной цвет", + "@rich_text_editor_toolbar_dialog_color_description": { + "description": "Description of the dialog to choose the foreground/background color of the text." + }, + "settings_confirm_before_exiting_title": "Подтвердить перед выходом", + "@settings_confirm_before_exiting_title": { + "description": "Title of the setting tile for whether a confirmation is required before exiting the application." + }, + "settings_confirm_before_exiting_description": "Спрашивать подтверждение перед выходом из приложения", + "@settings_confirm_before_exiting_description": { + "description": "Description of the setting tile for whether a confirmation is required before exiting the application." + }, + "snack_bar_confirm_exiting": "Нажмите Назад еще раз, чтобы выйти из приложения.", + "@snack_bar_confirm_exiting": { + "description": "Snack bar asking the user to confirm exiting the application by pressing back again." } } \ No newline at end of file diff --git a/lib/l10n/translations/app_zh-TW.arb b/lib/l10n/translations/app_zh-TW.arb deleted file mode 100644 index 9e26dfee..00000000 --- a/lib/l10n/translations/app_zh-TW.arb +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/lib/pages/settings/pages/settings_about_page.dart b/lib/pages/settings/pages/settings_about_page.dart index c887265e..2600c0ff 100644 --- a/lib/pages/settings/pages/settings_about_page.dart +++ b/lib/pages/settings/pages/settings_about_page.dart @@ -54,12 +54,11 @@ class SettingsAboutPage extends StatelessWidget { child: Column( children: [ SettingSection( - divider: null, - title: context.l.settings_about_application, + title: SettingSectionTitle(context.l.settings_about_application), tiles: [ SettingAboutTile( - title: context.l.app_name, - description: 'v$appVersion ($appBuildNumber)', + applicationName: context.l.app_name, + applicationVersion: 'v$appVersion ($appBuildNumber)', applicationIcon: Image.asset(Asset.icon.path, fit: BoxFit.fitWidth, width: Sizes.appIcon.size), applicationLegalese: context.l.settings_licence_description, dialogChildren: [ @@ -70,44 +69,46 @@ class SettingsAboutPage extends StatelessWidget { ], ), SettingTextTile( - icon: Icons.build, - title: context.l.settings_build_mode, - description: SystemUtils().buildMode(context), + icon: SettingTileIcon(Icons.build), + title: Text(context.l.settings_build_mode), + description: Text(SystemUtils().buildMode(context)), ), ], ), SettingSection( - divider: null, - title: context.l.settings_about_links, + title: SettingSectionTitle(context.l.settings_about_links), tiles: [ SettingActionTile( - icon: SimpleIcons.github, - title: context.l.settings_github, - description: context.l.settings_github_description, + icon: SettingTileIcon(SimpleIcons.github), + title: Text(context.l.settings_github), + description: Text(context.l.settings_github_description), onTap: openGitHub, ), SettingActionTile( - icon: SimpleIcons.crowdin, - title: context.l.settings_localizations, - description: context.l.settings_localizations_description, + icon: SettingTileIcon(SimpleIcons.crowdin), + title: Text(context.l.settings_localizations), + description: Text(context.l.settings_localizations_description), onTap: openCrowdin, ), SettingActionTile( - icon: Icons.balance, - title: context.l.settings_licence, - description: context.l.settings_licence_description, + icon: SettingTileIcon(Icons.balance), + title: Text(context.l.settings_licence), + description: Text(context.l.settings_licence_description), onTap: openLicense, ), ], ), SettingSection( - divider: null, - title: context.l.settings_about_section_donate, + title: SettingSectionTitle(context.l.settings_about_section_donate), tiles: [ - SettingActionTile(icon: SimpleIcons.kofi, title: context.l.settings_donate_kofi, onTap: donateKoFi), SettingActionTile( - icon: SimpleIcons.paypal, - title: context.l.settings_donate_paypal, + icon: SettingTileIcon(SimpleIcons.kofi), + title: Text(context.l.settings_donate_kofi), + onTap: donateKoFi, + ), + SettingActionTile( + icon: SettingTileIcon(SimpleIcons.paypal), + title: Text(context.l.settings_donate_paypal), onTap: donatePayPal, ), ], diff --git a/lib/pages/settings/pages/settings_accessibility_page.dart b/lib/pages/settings/pages/settings_accessibility_page.dart index 99d9044b..03bae5e3 100644 --- a/lib/pages/settings/pages/settings_accessibility_page.dart +++ b/lib/pages/settings/pages/settings_accessibility_page.dart @@ -82,13 +82,14 @@ class _SettingsAppearancePageState extends ConsumerState (textScaling as num).formatAsPercentage(locale: SystemUtils().appLocaleLanguageCode), @@ -101,30 +102,30 @@ class _SettingsAppearancePageState extends ConsumerState child: Column( children: [ SettingSingleOptionTile.detailed( - icon: Icons.language, - title: context.l.settings_language, + icon: SettingTileIcon(Icons.language), + title: Text(context.l.settings_language), trailing: TextButton.icon(onPressed: _openCrowdin, label: Text(context.l.settings_language_contribute)), - value: locale.nativeDisplayLanguage.capitalizeFirstLetter, + value: SettingTileValue(locale.nativeDisplayLanguage.capitalizeFirstLetter), dialogTitle: context.l.settings_language, options: SupportedLanguage.values .map( @@ -115,13 +115,12 @@ class _SettingsAppearancePageState extends ConsumerState onSubmitted: _submittedLanguage, ), SettingSection( - divider: null, - title: context.l.settings_appearance_section_theming, + title: SettingSectionTitle(context.l.settings_appearance_section_theming), tiles: [ SettingSingleOptionTile.detailed( - icon: Icons.palette, - title: context.l.settings_theme, - value: ThemeUtils().themeModeTitle(context), + icon: SettingTileIcon(Icons.palette), + title: Text(context.l.settings_theme), + value: SettingTileValue(ThemeUtils().themeModeTitle(context)), dialogTitle: context.l.settings_theme, options: [ (value: ThemeMode.light, title: context.l.settings_theme_light, subtitle: null), @@ -133,31 +132,30 @@ class _SettingsAppearancePageState extends ConsumerState ), SettingSwitchTile( enabled: ThemeUtils().isDynamicThemingAvailable, - icon: Icons.bolt, - title: context.l.settings_dynamic_theming, - description: context.l.settings_dynamic_theming_description, + icon: SettingTileIcon(Icons.bolt), + title: Text(context.l.settings_dynamic_theming), + description: Text(context.l.settings_dynamic_theming_description), toggled: dynamicTheming, onChanged: _toggleDynamicTheming, ), SettingSwitchTile( enabled: isDarkMode, - icon: Icons.nightlight, - title: context.l.settings_black_theming, - description: context.l.settings_black_theming_description, + icon: SettingTileIcon(Icons.nightlight), + title: Text(context.l.settings_black_theming), + description: Text(context.l.settings_black_theming_description), toggled: blackTheming, onChanged: _toggleBlackTheming, ), ], ), SettingSection( - divider: null, - title: context.l.settings_appearance_section_fonts, + title: SettingSectionTitle(context.l.settings_appearance_section_fonts), tiles: [ SettingSingleOptionTile.detailed( - icon: Icons.font_download, - title: context.l.settings_app_font, - description: context.l.settings_app_font_description, - value: appFont.displayName(context), + icon: SettingTileIcon(Icons.font_download), + title: Text(context.l.settings_app_font), + description: Text(context.l.settings_app_font_description), + value: SettingTileValue(appFont.displayName(context)), dialogTitle: context.l.settings_app_font, options: Font.values .map((font) => (value: font, title: font.displayName(context), subtitle: null)) @@ -166,10 +164,10 @@ class _SettingsAppearancePageState extends ConsumerState onSubmitted: _submittedAppFont, ), SettingSingleOptionTile.detailed( - icon: Icons.font_download, - title: context.l.settings_editor_font, - description: context.l.settings_editor_font_description, - value: editorFont.displayName(context), + icon: SettingTileIcon(Icons.font_download), + title: Text(context.l.settings_editor_font), + description: Text(context.l.settings_editor_font_description), + value: SettingTileValue(editorFont.displayName(context)), dialogTitle: context.l.settings_editor_font, options: Font.values .map((font) => (value: font, title: font.displayName(context), subtitle: null)) diff --git a/lib/pages/settings/pages/settings_backup_page.dart b/lib/pages/settings/pages/settings_backup_page.dart index 5200616d..815c3905 100644 --- a/lib/pages/settings/pages/settings_backup_page.dart +++ b/lib/pages/settings/pages/settings_backup_page.dart @@ -214,60 +214,59 @@ class _SettingsBackupPageState extends ConsumerState { child: Column( children: [ SettingSection( - divider: null, - title: context.l.settings_backup_import, + title: SettingSectionTitle(context.l.settings_backup_import), tiles: [ SettingActionTile( - icon: Icons.file_upload, - title: context.l.settings_import, - description: context.l.settings_import_description, + icon: SettingTileIcon(Icons.file_upload), + title: Text(context.l.settings_import), + description: Text(context.l.settings_import_description), onTap: _import, ), ], ), SettingSection( - divider: null, - title: context.l.settings_backup_manual_export, + title: SettingSectionTitle(context.l.settings_backup_manual_export), tiles: [ SettingActionTile( - icon: SimpleIcons.json, - title: context.l.settings_export_json, - description: context.l.settings_export_json_description, + icon: SettingTileIcon(SimpleIcons.json), + title: Text(context.l.settings_export_json), + description: Text(context.l.settings_export_json_description), onTap: _exportAsJson, ), SettingActionTile( - icon: SimpleIcons.markdown, - title: context.l.settings_export_markdown, - description: context.l.settings_export_markdown_description, + icon: SettingTileIcon(SimpleIcons.markdown), + title: Text(context.l.settings_export_markdown), + description: Text(context.l.settings_export_markdown_description), onTap: _exportAsMarkdown, ), ], ), SettingSection( - divider: null, - title: context.l.settings_backup_auto_export, + title: SettingSectionTitle(context.l.settings_backup_auto_export), tiles: [ SettingSwitchTile( - icon: Icons.settings_backup_restore, - title: context.l.settings_auto_export, - description: context.l.settings_auto_export_description, + icon: SettingTileIcon(Icons.settings_backup_restore), + title: Text(context.l.settings_auto_export), + description: Text(context.l.settings_auto_export_description), toggled: enableAutoExport, onChanged: _toggleEnableAutoExport, ), SettingSwitchTile( enabled: enableAutoExport, - icon: Icons.enhanced_encryption, - title: context.l.settings_auto_export_encryption, - description: context.l.settings_auto_export_encryption_description, + icon: SettingTileIcon(Icons.enhanced_encryption), + title: Text(context.l.settings_auto_export_encryption), + description: Text(context.l.settings_auto_export_encryption_description), toggled: autoExportEncryption, onChanged: _toggleAutoExportEncryption, ), SettingCustomSliderTile( enabled: enableAutoExport, - icon: Symbols.calendar_clock, - title: context.l.settings_auto_export_frequency, - value: context.l.settings_auto_export_frequency_value(autoExportFrequency.toString()), - description: context.l.settings_auto_export_frequency_description, + icon: SettingTileIcon(Symbols.calendar_clock), + title: Text(context.l.settings_auto_export_frequency), + value: SettingTileValue( + context.l.settings_auto_export_frequency_value(autoExportFrequency.toString()), + ), + description: Text(context.l.settings_auto_export_frequency_description), dialogTitle: context.l.settings_auto_export_frequency, label: (frequency) => context.l.settings_auto_export_frequency_value(frequency.toInt().toString()), values: automaticExportFrequenciesValues, @@ -276,10 +275,10 @@ class _SettingsBackupPageState extends ConsumerState { ), SettingActionTile( enabled: enableAutoExport, - icon: Icons.folder, - title: context.l.settings_auto_export_directory, - value: autoExportDirectory, - description: context.l.settings_auto_export_directory_description, + icon: SettingTileIcon(Icons.folder), + title: Text(context.l.settings_auto_export_directory), + value: SettingTileValue(autoExportDirectory), + description: Text(context.l.settings_auto_export_directory_description), trailing: IconButton( icon: const Icon(Symbols.reset_settings), tooltip: context.l.tooltip_reset, diff --git a/lib/pages/settings/pages/settings_behavior_page.dart b/lib/pages/settings/pages/settings_behavior_page.dart index 02bab051..77df38dc 100644 --- a/lib/pages/settings/pages/settings_behavior_page.dart +++ b/lib/pages/settings/pages/settings_behavior_page.dart @@ -122,21 +122,20 @@ class _SettingsBehaviorPageState extends ConsumerState { child: Column( children: [ SettingSection( - divider: null, - title: context.l.settings_behavior_application, + title: SettingSectionTitle(context.l.settings_behavior_application), tiles: [ SettingSwitchTile( - icon: Icons.exit_to_app, - title: context.l.settings_confirm_before_exiting_title, - description: context.l.settings_confirm_before_exiting_description, + icon: SettingTileIcon(Icons.exit_to_app), + title: Text(context.l.settings_confirm_before_exiting_title), + description: Text(context.l.settings_confirm_before_exiting_description), toggled: confirmBeforeExiting, onChanged: submittedConfirmBeforeExiting, ), SettingSingleOptionTile.detailed( - icon: Icons.warning, - title: context.l.settings_confirmations, - value: confirmations.title(context), - description: context.l.settings_confirmations_description, + icon: SettingTileIcon(Icons.warning), + title: Text(context.l.settings_confirmations), + value: SettingTileValue(confirmations.title(context)), + description: Text(context.l.settings_confirmations_description), dialogTitle: context.l.settings_confirmations, options: Confirmations.values .map( @@ -147,10 +146,12 @@ class _SettingsBehaviorPageState extends ConsumerState { onSubmitted: submittedConfirmations, ), SettingCustomSliderTile( - icon: Icons.auto_delete, - title: context.l.settings_auto_remove_from_bin_title, - value: context.l.settings_auto_remove_from_bin_value(autoRemoveFromBinDelay.toString()), - description: context.l.settings_auto_remove_from_bin_description, + icon: SettingTileIcon(Icons.auto_delete), + title: Text(context.l.settings_auto_remove_from_bin_title), + value: SettingTileValue( + context.l.settings_auto_remove_from_bin_value(autoRemoveFromBinDelay.toString()), + ), + description: Text(context.l.settings_auto_remove_from_bin_description), dialogTitle: context.l.settings_auto_remove_from_bin_title, label: (delay) => context.l.settings_auto_remove_from_bin_value(delay.toInt().toString()), values: autoRemoveFromBinValues, @@ -160,14 +161,13 @@ class _SettingsBehaviorPageState extends ConsumerState { ], ), SettingSection( - divider: null, - title: context.l.settings_behavior_swipe_actions, + title: SettingSectionTitle(context.l.settings_behavior_swipe_actions), tiles: [ SettingSingleOptionTile.detailed( - icon: Icons.swipe_right, - title: context.l.settings_swipe_action_right, - value: availableSwipeActions.right.title(context), - description: context.l.settings_swipe_action_right_description, + icon: SettingTileIcon(Icons.swipe_right), + title: Text(context.l.settings_swipe_action_right), + value: SettingTileValue(availableSwipeActions.right.title(context)), + description: Text(context.l.settings_swipe_action_right_description), dialogTitle: context.l.settings_swipe_action_right, options: AvailableSwipeAction.settings .map((swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null)) @@ -176,10 +176,10 @@ class _SettingsBehaviorPageState extends ConsumerState { onSubmitted: submittedAvailableSwipeRightAction, ), SettingSingleOptionTile.detailed( - icon: Icons.swipe_left, - title: context.l.settings_swipe_action_left, - value: availableSwipeActions.left.title(context), - description: context.l.settings_swipe_action_left_description, + icon: SettingTileIcon(Icons.swipe_left), + title: Text(context.l.settings_swipe_action_left), + value: SettingTileValue(availableSwipeActions.left.title(context)), + description: Text(context.l.settings_swipe_action_left_description), dialogTitle: context.l.settings_swipe_action_left, options: AvailableSwipeAction.settings .map((swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null)) @@ -190,14 +190,13 @@ class _SettingsBehaviorPageState extends ConsumerState { ], ), SettingSection( - divider: null, - title: context.l.settings_behavior_swipe_actions_archives, + title: SettingSectionTitle(context.l.settings_behavior_swipe_actions_archives), tiles: [ SettingSingleOptionTile.detailed( - icon: Icons.swipe_right, - title: context.l.settings_swipe_action_right, - value: archivedSwipeActions.right.title(context), - description: context.l.settings_swipe_action_right_description, + icon: SettingTileIcon(Icons.swipe_right), + title: Text(context.l.settings_swipe_action_right), + value: SettingTileValue(archivedSwipeActions.right.title(context)), + description: Text(context.l.settings_swipe_action_right_description), dialogTitle: context.l.settings_swipe_action_right, options: ArchivedSwipeAction.values .map((swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null)) @@ -206,10 +205,10 @@ class _SettingsBehaviorPageState extends ConsumerState { onSubmitted: submittedArchivedSwipeRightAction, ), SettingSingleOptionTile.detailed( - icon: Icons.swipe_left, - title: context.l.settings_swipe_action_left, - value: archivedSwipeActions.left.title(context), - description: context.l.settings_swipe_action_left_description, + icon: SettingTileIcon(Icons.swipe_left), + title: Text(context.l.settings_swipe_action_left), + value: SettingTileValue(archivedSwipeActions.left.title(context)), + description: Text(context.l.settings_swipe_action_left_description), dialogTitle: context.l.settings_swipe_action_left, options: ArchivedSwipeAction.values .map((swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null)) @@ -220,14 +219,13 @@ class _SettingsBehaviorPageState extends ConsumerState { ], ), SettingSection( - divider: null, - title: context.l.settings_behavior_swipe_actions_bin, + title: SettingSectionTitle(context.l.settings_behavior_swipe_actions_bin), tiles: [ SettingSingleOptionTile.detailed( - icon: Icons.swipe_right, - title: context.l.settings_swipe_action_right, - value: deletedSwipeActions.right.title(context), - description: context.l.settings_bin_swipe_action_right_description, + icon: SettingTileIcon(Icons.swipe_right), + title: Text(context.l.settings_swipe_action_right), + value: SettingTileValue(deletedSwipeActions.right.title(context)), + description: Text(context.l.settings_bin_swipe_action_right_description), dialogTitle: context.l.settings_swipe_action_right, options: DeletedSwipeAction.values .map((swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null)) @@ -236,10 +234,10 @@ class _SettingsBehaviorPageState extends ConsumerState { onSubmitted: submittedDeletedSwipeRightAction, ), SettingSingleOptionTile.detailed( - icon: Icons.swipe_left, - title: context.l.settings_swipe_action_left, - value: deletedSwipeActions.left.title(context), - description: context.l.settings_bin_swipe_action_left_description, + icon: SettingTileIcon(Icons.swipe_left), + title: Text(context.l.settings_swipe_action_left), + value: SettingTileValue(deletedSwipeActions.left.title(context)), + description: Text(context.l.settings_bin_swipe_action_left_description), dialogTitle: context.l.settings_swipe_action_left, options: DeletedSwipeAction.values .map((swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null)) diff --git a/lib/pages/settings/pages/settings_editor_page.dart b/lib/pages/settings/pages/settings_editor_page.dart index b2bf297b..cb8a842f 100644 --- a/lib/pages/settings/pages/settings_editor_page.dart +++ b/lib/pages/settings/pages/settings_editor_page.dart @@ -52,28 +52,27 @@ class _SettingsEditorPageState extends State { child: Column( children: [ SettingSection( - divider: null, - title: context.l.settings_editor_behavior, + title: SettingSectionTitle(context.l.settings_editor_behavior), tiles: [ SettingSwitchTile( - icon: Icons.edit, - title: context.l.settings_show_editor_mode_button, - description: context.l.settings_show_editor_mode_button_description, + icon: SettingTileIcon(Icons.edit), + title: Text(context.l.settings_show_editor_mode_button), + description: Text(context.l.settings_show_editor_mode_button_description), toggled: showEditorModeButton, onChanged: _toggleShowEditorModeButton, ), SettingSwitchTile( enabled: showEditorModeButton, - icon: Icons.visibility, - title: context.l.settings_open_editor_reading_mode, - description: context.l.settings_open_editor_reading_mode_description, + icon: SettingTileIcon(Icons.visibility), + title: Text(context.l.settings_open_editor_reading_mode), + description: Text(context.l.settings_open_editor_reading_mode_description), toggled: openEditorInReadMode, onChanged: _toggleOpenEditorInReadMode, ), SettingSwitchTile( - icon: Icons.filter_center_focus, - title: context.l.settings_focus_title_on_new_note, - description: context.l.settings_focus_title_on_new_note_description, + icon: SettingTileIcon(Icons.filter_center_focus), + title: Text(context.l.settings_focus_title_on_new_note), + description: Text(context.l.settings_focus_title_on_new_note_description), toggled: focusTitleOnNewNote, onChanged: _toggleFocusTitleOnNewNote, ), diff --git a/lib/pages/settings/pages/settings_help_page.dart b/lib/pages/settings/pages/settings_help_page.dart index 95656444..94fffee8 100644 --- a/lib/pages/settings/pages/settings_help_page.dart +++ b/lib/pages/settings/pages/settings_help_page.dart @@ -67,43 +67,41 @@ class SettingsHelpPage extends StatelessWidget { child: Column( children: [ SettingSection( - divider: null, - title: context.l.settings_help_section_contact, + title: SettingSectionTitle(context.l.settings_help_section_contact), tiles: [ SettingActionTile( - icon: Icons.bug_report, - title: context.l.settings_github_issues, - description: context.l.settings_github_issues_description, + icon: SettingTileIcon(Icons.bug_report), + title: Text(context.l.settings_github_issues), + description: Text(context.l.settings_github_issues_description), onTap: openGitHubIssues, ), SettingActionTile( - icon: Icons.forum, - title: context.l.settings_github_discussions, - description: context.l.settings_github_discussions_description, + icon: SettingTileIcon(Icons.forum), + title: Text(context.l.settings_github_discussions), + description: Text(context.l.settings_github_discussions_description), onTap: openGitHubDiscussions, ), SettingActionTile( - icon: Icons.mail, - title: context.l.settings_contact_developer, - description: context.l.settings_get_in_touch_description(contactEmail), + icon: SettingTileIcon(Icons.mail), + title: Text(context.l.settings_contact_developer), + description: Text(context.l.settings_get_in_touch_description(contactEmail)), onTap: sendMail, ), ], ), SettingSection( - divider: null, - title: context.l.settings_help_section_logs, + title: SettingSectionTitle(context.l.settings_help_section_logs), tiles: [ SettingActionTile( - icon: Icons.copy_all, - title: context.l.settings_copy_logs, - description: context.l.settings_copy_logs_description, + icon: SettingTileIcon(Icons.copy_all), + title: Text(context.l.settings_copy_logs), + description: Text(context.l.settings_copy_logs_description), onTap: () => copyLogs(context), ), SettingActionTile( - icon: Symbols.file_save, - title: context.l.settings_export_logs, - description: context.l.settings_export_logs_description, + icon: SettingTileIcon(Symbols.file_save), + title: Text(context.l.settings_export_logs), + description: Text(context.l.settings_export_logs_description), onTap: () => exportLogs(context), ), ], diff --git a/lib/pages/settings/pages/settings_labels_page.dart b/lib/pages/settings/pages/settings_labels_page.dart index 655ccda4..7535b447 100644 --- a/lib/pages/settings/pages/settings_labels_page.dart +++ b/lib/pages/settings/pages/settings_labels_page.dart @@ -77,48 +77,45 @@ class _SettingsLabelsPageState extends State { child: Column( children: [ SettingSection( - divider: null, tiles: [ SettingSwitchTile( - icon: Icons.label, - title: context.l.settings_enable_labels, - description: context.l.settings_enable_labels_description, + icon: SettingTileIcon(Icons.label), + title: Text(context.l.settings_enable_labels), + description: Text(context.l.settings_enable_labels_description), toggled: isLabelsEnabled, onChanged: toggleEnableLabels, ), ], ), SettingSection( - divider: null, - title: context.l.settings_labels_appearance, + title: SettingSectionTitle(context.l.settings_labels_appearance), tiles: [ SettingSwitchTile( enabled: isLabelsEnabled, - icon: Symbols.tile_small, - title: context.l.settings_show_labels_note_tile, - description: context.l.settings_show_labels_note_tile_description, + icon: SettingTileIcon(Symbols.tile_small), + title: Text(context.l.settings_show_labels_note_tile), + description: Text(context.l.settings_show_labels_note_tile_description), toggled: showLabelsListOnNoteTile, onChanged: toggleShowLabelsListOnNoteTile, ), SettingSwitchTile( enabled: isLabelsEnabled, - icon: Icons.edit, - title: context.l.settings_show_labels_editor, - description: context.l.settings_show_labels_editor_description, + icon: SettingTileIcon(Icons.edit), + title: Text(context.l.settings_show_labels_editor), + description: Text(context.l.settings_show_labels_editor_description), toggled: showLabelsListInEditorPage, onChanged: toggleShowLabelsListInEditor, ), ], ), SettingSection( - divider: null, - title: context.l.settings_labels_section_behavior, + title: SettingSectionTitle(context.l.settings_labels_section_behavior), tiles: [ SettingSingleOptionTile.detailed( - icon: Icons.swipe_right, - title: context.l.settings_swipe_action_right, - value: labelSwipeActions.right.title(context), - description: context.l.settings_swipe_action_right_description, + icon: SettingTileIcon(Icons.swipe_right), + title: Text(context.l.settings_swipe_action_right), + value: SettingTileValue(labelSwipeActions.right.title(context)), + description: Text(context.l.settings_swipe_action_right_description), dialogTitle: context.l.settings_swipe_action_right, options: LabelSwipeAction.settings .map((swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null)) @@ -127,10 +124,10 @@ class _SettingsLabelsPageState extends State { onSubmitted: submittedLabelSwipeRightAction, ), SettingSingleOptionTile.detailed( - icon: Icons.swipe_left, - title: context.l.settings_swipe_action_left, - value: labelSwipeActions.left.title(context), - description: context.l.settings_swipe_action_left_description, + icon: SettingTileIcon(Icons.swipe_left), + title: Text(context.l.settings_swipe_action_left), + value: SettingTileValue(labelSwipeActions.left.title(context)), + description: Text(context.l.settings_swipe_action_left_description), dialogTitle: context.l.settings_swipe_action_left, options: LabelSwipeAction.settings .map((swipeAction) => (value: swipeAction, title: swipeAction.title(context), subtitle: null)) diff --git a/lib/pages/settings/pages/settings_notes_tiles_page.dart b/lib/pages/settings/pages/settings_notes_tiles_page.dart index c8e90f39..a7b43c49 100644 --- a/lib/pages/settings/pages/settings_notes_tiles_page.dart +++ b/lib/pages/settings/pages/settings_notes_tiles_page.dart @@ -78,49 +78,47 @@ class _SettingsNotesTilesPageState extends ConsumerState child: Column( children: [ SettingSection( - divider: null, - title: context.l.settings_page_notes_tiles_appearance_section, + title: SettingSectionTitle(context.l.settings_page_notes_tiles_appearance_section), tiles: [ SettingSwitchTile( - icon: Icons.gradient, - title: context.l.settings_show_tiles_background, - description: context.l.settings_show_tiles_background_description, + icon: SettingTileIcon(Icons.gradient), + title: Text(context.l.settings_show_tiles_background), + description: Text(context.l.settings_show_tiles_background_description), toggled: showTilesBackground, onChanged: _toggleShowTilesBackground, ), SettingSwitchTile( - icon: Icons.safety_divider, - title: context.l.settings_show_separators, - description: context.l.settings_show_separators_description, + icon: SettingTileIcon(Icons.safety_divider), + title: Text(context.l.settings_show_separators), + description: Text(context.l.settings_show_separators_description), toggled: showSeparators, onChanged: _toggleShowSeparators, ), ], ), SettingSection( - divider: null, - title: context.l.settings_page_notes_tiles_content_section, + title: SettingSectionTitle(context.l.settings_page_notes_tiles_content_section), tiles: [ SettingSwitchTile( - icon: Icons.title, - title: context.l.settings_show_titles_only, - description: context.l.settings_show_titles_only_description, + icon: SettingTileIcon(Icons.title), + title: Text(context.l.settings_show_titles_only), + description: Text(context.l.settings_show_titles_only_description), toggled: showTitlesOnly, onChanged: _toggleShowTitlesOnly, ), SettingSwitchTile( enabled: showTitlesOnly, - icon: Symbols.feature_search, - title: context.l.settings_show_titles_only_disable_in_search_view, - description: context.l.settings_show_titles_only_disable_in_search_view_description, + icon: SettingTileIcon(Symbols.feature_search), + title: Text(context.l.settings_show_titles_only_disable_in_search_view), + description: Text(context.l.settings_show_titles_only_disable_in_search_view_description), toggled: showTitlesOnlyDisableInSearchView, onChanged: _toggleShowTitlesOnlyDisableInSearchView, ), SettingSliderTile( - icon: Icons.short_text, - title: context.l.settings_content_preview_max_lines, - description: context.l.settings_content_preview_max_lines_description, - value: '$maximumContentPreviewLines', + icon: SettingTileIcon(Icons.short_text), + title: Text(context.l.settings_content_preview_max_lines), + description: Text(context.l.settings_content_preview_max_lines_description), + value: SettingTileValue('$maximumContentPreviewLines'), dialogTitle: context.l.settings_content_preview_max_lines, label: (maximumContentPreviewLines) => '${maximumContentPreviewLines.toInt()}', min: 1.0, @@ -130,9 +128,9 @@ class _SettingsNotesTilesPageState extends ConsumerState onSubmitted: _submittedMaximumContentPreviewLines, ), SettingSwitchTile( - icon: Icons.edit_note, - title: context.l.settings_show_note_type_icon, - description: context.l.settings_show_note_type_icon_description, + icon: SettingTileIcon(Icons.edit_note), + title: Text(context.l.settings_show_note_type_icon), + description: Text(context.l.settings_show_note_type_icon_description), toggled: showNoteTypeIcon, onChanged: _toggleShowNoteTypeIcon, ), diff --git a/lib/pages/settings/pages/settings_notes_types_page.dart b/lib/pages/settings/pages/settings_notes_types_page.dart index 301a6697..ad096f11 100644 --- a/lib/pages/settings/pages/settings_notes_types_page.dart +++ b/lib/pages/settings/pages/settings_notes_types_page.dart @@ -78,14 +78,13 @@ class _SettingsNotesTypesPageState extends ConsumerState child: Column( children: [ SettingSection( - divider: null, - title: context.l.settings_section_types_to_use, + title: SettingSectionTitle(context.l.settings_section_types_to_use), tiles: [ SettingMultipleOptionsTile.detailed( - icon: Icons.edit_note, - title: context.l.settings_available_notes_types, - value: availableNotesTypesString, - description: context.l.settings_available_notes_types_description, + icon: SettingTileIcon(Icons.edit_note), + title: Text(context.l.settings_available_notes_types), + value: SettingTileValue(availableNotesTypesString), + description: Text(context.l.settings_available_notes_types_description), dialogTitle: context.l.settings_available_notes_types, options: notesTypes, initialOptions: availableNotesTypes, @@ -93,10 +92,10 @@ class _SettingsNotesTypesPageState extends ConsumerState onSubmitted: onSubmittedAvailableNotesTypes, ), SettingSingleOptionTile.detailed( - icon: Icons.share, - title: context.l.settings_available_default_share_type, - value: defaultShareNoteType.title(context), - description: context.l.settings_available_default_share_type_description, + icon: SettingTileIcon(Icons.share), + title: Text(context.l.settings_available_default_share_type), + value: SettingTileValue(defaultShareNoteType.title(context)), + description: Text(context.l.settings_available_default_share_type_description), dialogTitle: context.l.settings_available_default_share_type, options: shareNotesTypes, initialOption: defaultShareNoteType, @@ -105,23 +104,22 @@ class _SettingsNotesTypesPageState extends ConsumerState ], ), SettingSection( - divider: null, - title: NoteType.richText.title(context), + title: SettingSectionTitle(NoteType.richText.title(context)), tiles: [ SettingSingleOptionTile.detailed( - icon: Icons.format_paint, - title: context.l.settings_toolbar_style_title, - value: toolbarStyle.title(context), - description: context.l.settings_toolbar_style_description, + icon: SettingTileIcon(Icons.format_paint), + title: Text(context.l.settings_toolbar_style_title), + value: SettingTileValue(toolbarStyle.title(context)), + description: Text(context.l.settings_toolbar_style_description), dialogTitle: context.l.settings_toolbar_style_title, options: toolbarStyleOptions, initialOption: toolbarStyle, onSubmitted: onSubmittedToolbarStyle, ), SettingSwitchTile( - icon: Icons.format_line_spacing, - title: context.l.settings_use_paragraph_spacing, - description: context.l.settings_use_paragraph_spacing_description, + icon: SettingTileIcon(Icons.format_line_spacing), + title: Text(context.l.settings_use_paragraph_spacing), + description: Text(context.l.settings_use_paragraph_spacing_description), toggled: useParagraphsSpacing, onChanged: _toggleUseParagraphSpacing, ), diff --git a/lib/pages/settings/pages/settings_security_page.dart b/lib/pages/settings/pages/settings_security_page.dart index 2a815aca..6c1dccb1 100644 --- a/lib/pages/settings/pages/settings_security_page.dart +++ b/lib/pages/settings/pages/settings_security_page.dart @@ -123,36 +123,34 @@ class _SettingsBehaviorPageState extends ConsumerState { child: Column( children: [ SettingSection( - divider: null, - title: context.l.settings_security_application, + title: SettingSectionTitle(context.l.settings_security_application), tiles: [ SettingSwitchTile( - icon: Icons.screenshot, - title: context.l.settings_flag_secure, - description: context.l.settings_flag_secure_description, + icon: SettingTileIcon(Icons.screenshot), + title: Text(context.l.settings_flag_secure), + description: Text(context.l.settings_flag_secure_description), toggled: flagSecure, onChanged: toggledFlagSecure, ), ], ), SettingSection( - divider: null, - title: context.l.settings_security_application_lock, + title: SettingSectionTitle(context.l.settings_security_application_lock), tiles: [ SettingSwitchTile( enabled: isSystemAuthenticationAvailable, - icon: Icons.lock, - title: context.l.settings_application_lock_title, - description: context.l.settings_application_lock_description, + icon: SettingTileIcon(Icons.lock), + title: Text(context.l.settings_application_lock_title), + description: Text(context.l.settings_application_lock_description), toggled: lockApp, onChanged: toggledLockApp, ), SettingCustomSliderTile( enabled: isSystemAuthenticationAvailable && lockApp, - icon: Icons.timelapse, - title: context.l.settings_application_lock_delay_title, - value: context.l.settings_lock_delay_value(lockAppDelay.toString()), - description: context.l.settings_application_lock_delay_description, + icon: SettingTileIcon(Icons.timelapse), + title: Text(context.l.settings_application_lock_delay_title), + value: SettingTileValue(context.l.settings_lock_delay_value(lockAppDelay.toString())), + description: Text(context.l.settings_application_lock_delay_description), dialogTitle: context.l.settings_application_lock_delay_title, label: (delay) => context.l.settings_lock_delay_value(delay.toInt().toString()), values: lockDelayValues, @@ -162,31 +160,30 @@ class _SettingsBehaviorPageState extends ConsumerState { ], ), SettingSection( - divider: null, - title: context.l.settings_security_note_lock, + title: SettingSectionTitle(context.l.settings_security_note_lock), tiles: [ SettingSwitchTile( enabled: isSystemAuthenticationAvailable, - icon: Icons.notes, - title: context.l.settings_note_lock_title, - description: context.l.settings_note_lock_description, + icon: SettingTileIcon(Icons.notes), + title: Text(context.l.settings_note_lock_title), + description: Text(context.l.settings_note_lock_description), toggled: lockNote, onChanged: toggledLockNote, ), SettingSwitchTile( enabled: isSystemAuthenticationAvailable, - icon: Icons.label, - title: context.l.settings_label_lock_title, - description: context.l.settings_label_lock_description, + icon: SettingTileIcon(Icons.label), + title: Text(context.l.settings_label_lock_title), + description: Text(context.l.settings_label_lock_description), toggled: lockLabel, onChanged: toggledLockLabel, ), SettingCustomSliderTile( enabled: isSystemAuthenticationAvailable && lockNote, - icon: Icons.timelapse, - title: context.l.settings_note_lock_delay_title, - value: context.l.settings_lock_delay_value(lockNoteDelay.toString()), - description: context.l.settings_note_lock_delay_description, + icon: SettingTileIcon(Icons.timelapse), + title: Text(context.l.settings_note_lock_delay_title), + value: SettingTileValue(context.l.settings_lock_delay_value(lockNoteDelay.toString())), + description: Text(context.l.settings_note_lock_delay_description), dialogTitle: context.l.settings_note_lock_delay_title, label: (delay) => context.l.settings_lock_delay_value(delay.toInt().toString()), values: lockDelayValues, diff --git a/lib/pages/settings/settings_main_page.dart b/lib/pages/settings/settings_main_page.dart index 42b92128..d0a572c1 100644 --- a/lib/pages/settings/settings_main_page.dart +++ b/lib/pages/settings/settings_main_page.dart @@ -25,72 +25,71 @@ class SettingsMainPage extends StatelessWidget { child: Column( children: [ SettingSection( - divider: null, tiles: [ SettingActionTile( - icon: Icons.palette, - title: context.l.settings_page_appearance, - description: context.l.settings_page_appearance_description, + icon: SettingTileIcon(Icons.palette), + title: Text(context.l.settings_page_appearance), + description: Text(context.l.settings_page_appearance_description), onTap: () => context.goNamed(NavigationRoute.settingsAppearance.name), ), SettingActionTile( - icon: Icons.dashboard, - title: context.l.settings_page_notes_tiles, - description: context.l.settings_page_notes_tiles_description, + icon: SettingTileIcon(Icons.dashboard), + title: Text(context.l.settings_page_notes_tiles), + description: Text(context.l.settings_page_notes_tiles_description), onTap: () => context.goNamed(NavigationRoute.settingsNotesTiles.name), ), SettingActionTile( - icon: Icons.swipe, - title: context.l.settings_behavior, - description: context.l.settings_behavior_description, + icon: SettingTileIcon(Icons.swipe), + title: Text(context.l.settings_behavior), + description: Text(context.l.settings_behavior_description), onTap: () => context.goNamed(NavigationRoute.settingsBehavior.name), ), SettingActionTile( - icon: Icons.category, - title: context.l.settings_page_notes_types, - description: context.l.settings_page_notes_types_description, + icon: SettingTileIcon(Icons.category), + title: Text(context.l.settings_page_notes_types), + description: Text(context.l.settings_page_notes_types_description), onTap: () => context.goNamed(NavigationRoute.settingsNotesTypes.name), ), SettingActionTile( - icon: Icons.edit, - title: context.l.settings_editor, - description: context.l.settings_editor_description, + icon: SettingTileIcon(Icons.edit), + title: Text(context.l.settings_editor), + description: Text(context.l.settings_editor_description), onTap: () => context.goNamed(NavigationRoute.settingsEditor.name), ), SettingActionTile( - icon: Icons.label, - title: context.l.settings_labels, - description: context.l.settings_labels_description, + icon: SettingTileIcon(Icons.label), + title: Text(context.l.settings_labels), + description: Text(context.l.settings_labels_description), onTap: () => context.goNamed(NavigationRoute.settingsLabels.name), ), SettingActionTile( - icon: Icons.settings_backup_restore, - title: context.l.settings_backup, - description: context.l.settings_backup_description, + icon: SettingTileIcon(Icons.settings_backup_restore), + title: Text(context.l.settings_backup), + description: Text(context.l.settings_backup_description), onTap: () => context.goNamed(NavigationRoute.settingsBackup.name), ), SettingActionTile( - icon: Icons.security, - title: context.l.settings_security, - description: context.l.settings_security_description, + icon: SettingTileIcon(Icons.security), + title: Text(context.l.settings_security), + description: Text(context.l.settings_security_description), onTap: () => context.goNamed(NavigationRoute.settingsSecurity.name), ), SettingActionTile( - icon: Icons.accessibility, - title: context.l.settings_accessibility, - description: context.l.settings_accessibility_description, + icon: SettingTileIcon(Icons.accessibility), + title: Text(context.l.settings_accessibility), + description: Text(context.l.settings_accessibility_description), onTap: () => context.goNamed(NavigationRoute.settingsAccessibility.name), ), SettingActionTile( - icon: Icons.help, - title: context.l.settings_help, - description: context.l.settings_help_description, + icon: SettingTileIcon(Icons.help), + title: Text(context.l.settings_help), + description: Text(context.l.settings_help_description), onTap: () => context.goNamed(NavigationRoute.settingsHelp.name), ), SettingActionTile( - icon: Icons.info, - title: context.l.settings_about, - description: context.l.settings_about_description, + icon: SettingTileIcon(Icons.info), + title: Text(context.l.settings_about), + description: Text(context.l.settings_about_description), onTap: () => context.goNamed(NavigationRoute.settingsAbout.name), ), ], diff --git a/lib/providers/notes/notes_provider.dart b/lib/providers/notes/notes_provider.dart index 620e6dc5..4e4f4047 100644 --- a/lib/providers/notes/notes_provider.dart +++ b/lib/providers/notes/notes_provider.dart @@ -288,7 +288,7 @@ class Notes extends _$Notes { /// Removes the empty notes. Future removeEmpty() async { final emptyNotes = state.value?.where((note) => note.isEmpty).toList() ?? []; - + print(emptyNotes); try { await _notesService.deleteAll(emptyNotes); } catch (exception, stackTrace) { diff --git a/lib/services/notes/notes_service.dart b/lib/services/notes/notes_service.dart index 95755a12..e3fea689 100644 --- a/lib/services/notes/notes_service.dart +++ b/lib/services/notes/notes_service.dart @@ -284,8 +284,8 @@ class NotesService { await _database.writeTxn(() async { await _plainTextNotes.deleteAll(plainTextNotesIds); - await _markdownNotes.deleteAll(richTextNotesIds); - await _richTextNotes.deleteAll(markdownNotesIds); + await _markdownNotes.deleteAll(markdownNotesIds); + await _richTextNotes.deleteAll(richTextNotesIds); await _checklistNotes.deleteAll(checklistNotesIds); }); diff --git a/pubspec.lock b/pubspec.lock index 071f52c4..7f17599e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -170,10 +170,10 @@ packages: dependency: transitive description: name: built_value - sha256: "082001b5c3dc495d4a42f1d5789990505df20d8547d42507c29050af6933ee27" + sha256: "0b1b12a0a549605e5f04476031cd0bc91ead1d7c8e830773a18ee54179b3cb62" url: "https://pub.dev" source: hosted - version: "8.10.1" + version: "8.11.0" chalkdart: dependency: transitive description: @@ -846,10 +846,10 @@ packages: dependency: transitive description: name: local_auth_android - sha256: "63ad7ca6396290626dc0cb34725a939e4cfe965d80d36112f08d49cf13a8136e" + sha256: "82b2bdeee2199a510d3b7716121e96a6609da86693bb0863edd8566355406b79" url: "https://pub.dev" source: hosted - version: "1.0.49" + version: "1.0.50" local_auth_darwin: dependency: transitive description: @@ -1255,10 +1255,10 @@ packages: dependency: "direct main" description: name: saf_util - sha256: b18e57677fc704918b2a67d7b5aa1c9c61dc5f3f2e7e70480576db77d18bec4a + sha256: "219f983e5f17b28998335158cdc97add9d52af9884e38b5a43f10dcc070510ec" url: "https://pub.dev" source: hosted - version: "0.10.0" + version: "0.11.0" sanitize_filename: dependency: "direct main" description: @@ -1271,10 +1271,10 @@ packages: dependency: "direct main" description: name: settings_tiles - sha256: "7752b2b1d0828ddce79aa2b91cd8f75973a45597fcb12b0815f4e50ba173d513" + sha256: "13cfedde953c6c873b9defa387fe8f038abc2d8436ee45f4f941f336746ee34a" url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "6.0.1" share_plus: dependency: "direct main" description: @@ -1737,5 +1737,5 @@ packages: source: hosted version: "3.1.3" sdks: - dart: ">=3.8.0 <4.0.0" - flutter: ">=3.32.0" + dart: ">=3.8.1 <4.0.0" + flutter: ">=3.32.7" diff --git a/pubspec.yaml b/pubspec.yaml index 2442d942..b2f1c5f1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,12 +2,12 @@ name: localmaterialnotes description: Simple, local, material design notes repository: https://github.com/maelchiotti/LocalMaterialNotes -version: 2.0.0+28 +version: 2.1.0+29 publish_to: none environment: - sdk: ^3.8.0 - flutter: 3.32.0 + sdk: ^3.8.1 + flutter: 3.32.7 dependencies: after_layout: ^1.2.0 @@ -66,9 +66,9 @@ dependencies: restart_app: ^1.3.2 riverpod_annotation: ^2.6.1 saf_stream: ^0.11.3 - saf_util: ^0.10.0 + saf_util: ^0.11.0 sanitize_filename: ^1.0.5 - settings_tiles: ^4.1.0 + settings_tiles: ^6.0.1 share_plus: ^11.0.0 shared_preferences: ^2.5.3 simple_icons: ^14.6.1 diff --git a/scripts/generate_full_description.py b/scripts/generate_full_description.py index 1a41108b..85334d95 100644 --- a/scripts/generate_full_description.py +++ b/scripts/generate_full_description.py @@ -19,6 +19,11 @@ try: # Read and minimize the description inside the YAML file yaml_file = yaml.safe_load(yaml_stream) + + if yaml_file is None: + print("Skipped empty file for language " + language) + continue + full_description = yaml_file["full_description"] full_description_minified = minify_html.minify( full_description, keep_closing_tags=True From e5d914eac744201f0efbff91288a0a22fedddb97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Chiotti?= <44336112+maelchiotti@users.noreply.github.com> Date: Fri, 18 Jul 2025 19:54:17 +0200 Subject: [PATCH 9/9] misc: format --- lib/providers/notes/notes_provider.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/providers/notes/notes_provider.dart b/lib/providers/notes/notes_provider.dart index 4e4f4047..620e6dc5 100644 --- a/lib/providers/notes/notes_provider.dart +++ b/lib/providers/notes/notes_provider.dart @@ -288,7 +288,7 @@ class Notes extends _$Notes { /// Removes the empty notes. Future removeEmpty() async { final emptyNotes = state.value?.where((note) => note.isEmpty).toList() ?? []; - print(emptyNotes); + try { await _notesService.deleteAll(emptyNotes); } catch (exception, stackTrace) {