From fa780ad1029bc1cf8e3143e9d5d7fc746f184cf1 Mon Sep 17 00:00:00 2001 From: coolswood Date: Mon, 22 Apr 2024 03:49:24 +0300 Subject: [PATCH 01/10] fix: removed misleading parameters (#1825) * fix: removed misleading parameters * unused imports --- .../lib/embeds/image/toolbar/image_button.dart | 1 - .../lib/embeds/others/camera_button/camera_button.dart | 1 - .../lib/models/config/camera/camera_configurations.dart | 4 ---- .../lib/models/config/formula/formula_configurations.dart | 4 ---- .../models/config/image/toolbar/image_configurations.dart | 4 ---- .../models/config/media/media_button_configurations.dart | 2 -- .../models/config/video/toolbar/video_configurations.dart | 4 ---- .../config/toolbar/buttons/font_size_configurations.dart | 1 - .../config/toolbar/buttons/search_configurations.dart | 3 --- .../toolbar/buttons/toggle_check_list_configurations.dart | 4 ---- .../toolbar/buttons/toggle_style_configurations.dart | 4 ---- lib/src/models/themes/quill_icon_theme.dart | 7 ------- .../widgets/toolbar/buttons/toggle_check_list_button.dart | 1 - lib/src/widgets/toolbar/buttons/toggle_style_button.dart | 3 --- 14 files changed, 43 deletions(-) diff --git a/flutter_quill_extensions/lib/embeds/image/toolbar/image_button.dart b/flutter_quill_extensions/lib/embeds/image/toolbar/image_button.dart index 4c4b8655..4422dd0b 100644 --- a/flutter_quill_extensions/lib/embeds/image/toolbar/image_button.dart +++ b/flutter_quill_extensions/lib/embeds/image/toolbar/image_button.dart @@ -81,7 +81,6 @@ class QuillToolbarImageButton extends StatelessWidget { iconSize: iconSize, iconButtonFactor: iconButtonFactor, dialogTheme: options.dialogTheme, - fillColor: options.fillColor, iconTheme: options.iconTheme, linkRegExp: options.linkRegExp, tooltip: options.tooltip, diff --git a/flutter_quill_extensions/lib/embeds/others/camera_button/camera_button.dart b/flutter_quill_extensions/lib/embeds/others/camera_button/camera_button.dart index 2f23254b..e8e4418b 100644 --- a/flutter_quill_extensions/lib/embeds/others/camera_button/camera_button.dart +++ b/flutter_quill_extensions/lib/embeds/others/camera_button/camera_button.dart @@ -87,7 +87,6 @@ class QuillToolbarCameraButton extends StatelessWidget { QuillToolbarCameraButtonOptions( afterButtonPressed: _afterButtonPressed(context), iconData: options.iconData, - fillColor: options.fillColor, iconSize: options.iconSize, iconButtonFactor: iconButtonFactor, iconTheme: options.iconTheme, diff --git a/flutter_quill_extensions/lib/models/config/camera/camera_configurations.dart b/flutter_quill_extensions/lib/models/config/camera/camera_configurations.dart index 938fd702..bda1ea14 100644 --- a/flutter_quill_extensions/lib/models/config/camera/camera_configurations.dart +++ b/flutter_quill_extensions/lib/models/config/camera/camera_configurations.dart @@ -1,4 +1,3 @@ -import 'package:flutter/widgets.dart' show Color; import 'package:flutter_quill/flutter_quill.dart'; import '../../../embeds/others/camera_button/camera_types.dart'; @@ -18,7 +17,6 @@ class QuillToolbarCameraButtonOptions extends QuillToolbarBaseButtonOptions< this.cameraConfigurations = const QuillToolbarCameraConfigurations(), super.iconSize, super.iconButtonFactor, - this.fillColor, super.iconData, super.afterButtonPressed, super.tooltip, @@ -26,7 +24,5 @@ class QuillToolbarCameraButtonOptions extends QuillToolbarBaseButtonOptions< super.childBuilder, }); - final Color? fillColor; - final QuillToolbarCameraConfigurations cameraConfigurations; } diff --git a/flutter_quill_extensions/lib/models/config/formula/formula_configurations.dart b/flutter_quill_extensions/lib/models/config/formula/formula_configurations.dart index c8f87902..cbe79c18 100644 --- a/flutter_quill_extensions/lib/models/config/formula/formula_configurations.dart +++ b/flutter_quill_extensions/lib/models/config/formula/formula_configurations.dart @@ -1,4 +1,3 @@ -import 'package:flutter/widgets.dart' show Color; import 'package:flutter_quill/flutter_quill.dart'; class QuillToolbarFormulaButtonExtraOptions @@ -18,10 +17,7 @@ class QuillToolbarFormulaButtonOptions extends QuillToolbarBaseButtonOptions< super.iconTheme, super.afterButtonPressed, super.childBuilder, - this.fillColor, super.iconSize, super.iconButtonFactor, }); - - final Color? fillColor; } diff --git a/flutter_quill_extensions/lib/models/config/image/toolbar/image_configurations.dart b/flutter_quill_extensions/lib/models/config/image/toolbar/image_configurations.dart index 799285e1..fcdcd04d 100644 --- a/flutter_quill_extensions/lib/models/config/image/toolbar/image_configurations.dart +++ b/flutter_quill_extensions/lib/models/config/image/toolbar/image_configurations.dart @@ -1,4 +1,3 @@ -import 'package:flutter/widgets.dart' show Color; import 'package:flutter_quill/flutter_quill.dart'; import 'package:meta/meta.dart' show immutable; @@ -26,14 +25,11 @@ class QuillToolbarImageButtonOptions extends QuillToolbarBaseButtonOptions< super.afterButtonPressed, super.childBuilder, super.iconTheme, - this.fillColor, this.dialogTheme, this.linkRegExp, this.imageButtonConfigurations = const QuillToolbarImageConfigurations(), }); - final Color? fillColor; - final QuillDialogTheme? dialogTheme; /// [imageLinkRegExp] is a regular expression to identify image links. diff --git a/flutter_quill_extensions/lib/models/config/media/media_button_configurations.dart b/flutter_quill_extensions/lib/models/config/media/media_button_configurations.dart index 9cefeaac..c25bf08a 100644 --- a/flutter_quill_extensions/lib/models/config/media/media_button_configurations.dart +++ b/flutter_quill_extensions/lib/models/config/media/media_button_configurations.dart @@ -24,7 +24,6 @@ class QuillToolbarMediaButtonOptions extends QuillToolbarBaseButtonOptions< this.childrenSpacing = 16.0, this.autovalidateMode = AutovalidateMode.disabled, super.iconSize, - this.fillColor, this.dialogTheme, this.labelText, this.hintText, @@ -40,7 +39,6 @@ class QuillToolbarMediaButtonOptions extends QuillToolbarBaseButtonOptions< super.childBuilder, }); - final Color? fillColor; final QuillMediaType type; final QuillDialogTheme? dialogTheme; final MediaFilePicker? mediaFilePicker; diff --git a/flutter_quill_extensions/lib/models/config/video/toolbar/video_configurations.dart b/flutter_quill_extensions/lib/models/config/video/toolbar/video_configurations.dart index b68b7729..c32305e5 100644 --- a/flutter_quill_extensions/lib/models/config/video/toolbar/video_configurations.dart +++ b/flutter_quill_extensions/lib/models/config/video/toolbar/video_configurations.dart @@ -1,4 +1,3 @@ -import 'package:flutter/widgets.dart' show Color; import 'package:flutter_quill/flutter_quill.dart'; import '../../../../embeds/video/video.dart'; @@ -17,7 +16,6 @@ class QuillToolbarVideoButtonOptions extends QuillToolbarBaseButtonOptions< const QuillToolbarVideoButtonOptions({ this.linkRegExp, this.dialogTheme, - this.fillColor, super.iconSize, super.iconButtonFactor, super.iconData, @@ -31,6 +29,4 @@ class QuillToolbarVideoButtonOptions extends QuillToolbarBaseButtonOptions< final RegExp? linkRegExp; final QuillDialogTheme? dialogTheme; final QuillToolbarVideoConfigurations videoConfigurations; - - final Color? fillColor; } diff --git a/lib/src/models/config/toolbar/buttons/font_size_configurations.dart b/lib/src/models/config/toolbar/buttons/font_size_configurations.dart index e926e184..e351387c 100644 --- a/lib/src/models/config/toolbar/buttons/font_size_configurations.dart +++ b/lib/src/models/config/toolbar/buttons/font_size_configurations.dart @@ -75,7 +75,6 @@ class QuillToolbarFontSizeButtonOptions extends QuillToolbarBaseButtonOptions< QuillToolbarFontSizeButtonOptions copyWith({ double? iconSize, double? iconButtonFactor, - Color? fillColor, double? hoverElevation, double? highlightElevation, List>? items, diff --git a/lib/src/models/config/toolbar/buttons/search_configurations.dart b/lib/src/models/config/toolbar/buttons/search_configurations.dart index 8851fe5f..e110c3ea 100644 --- a/lib/src/models/config/toolbar/buttons/search_configurations.dart +++ b/lib/src/models/config/toolbar/buttons/search_configurations.dart @@ -23,7 +23,6 @@ class QuillToolbarSearchButtonOptions extends QuillToolbarBaseButtonOptions< super.iconSize, super.iconButtonFactor, this.dialogBarrierColor, - this.fillColor, this.customOnPressedCallback, }); @@ -32,8 +31,6 @@ class QuillToolbarSearchButtonOptions extends QuillToolbarBaseButtonOptions< /// By default will be [dialogBarrierColor] from [QuillSharedConfigurations] final Color? dialogBarrierColor; - final Color? fillColor; - /// By default we will show simple search dialog ui /// you can pass value to this callback to change this final QuillToolbarSearchButtonOnPressedCallback? customOnPressedCallback; diff --git a/lib/src/models/config/toolbar/buttons/toggle_check_list_configurations.dart b/lib/src/models/config/toolbar/buttons/toggle_check_list_configurations.dart index de30d3b8..c73275c6 100644 --- a/lib/src/models/config/toolbar/buttons/toggle_check_list_configurations.dart +++ b/lib/src/models/config/toolbar/buttons/toggle_check_list_configurations.dart @@ -1,5 +1,4 @@ import 'package:flutter/foundation.dart' show immutable; -import 'package:flutter/widgets.dart' show Color; import '../../../documents/attribute.dart'; import '../../quill_configurations.dart'; @@ -23,7 +22,6 @@ class QuillToolbarToggleCheckListButtonOptions const QuillToolbarToggleCheckListButtonOptions({ super.iconSize, super.iconButtonFactor, - this.fillColor, this.attribute = Attribute.unchecked, this.isShouldRequestKeyboard = false, super.iconTheme, @@ -33,8 +31,6 @@ class QuillToolbarToggleCheckListButtonOptions super.childBuilder, }); - final Color? fillColor; - final Attribute attribute; /// Should we request the keyboard when you press the toggle check list button diff --git a/lib/src/models/config/toolbar/buttons/toggle_style_configurations.dart b/lib/src/models/config/toolbar/buttons/toggle_style_configurations.dart index 5caa1447..e1c2ac78 100644 --- a/lib/src/models/config/toolbar/buttons/toggle_style_configurations.dart +++ b/lib/src/models/config/toolbar/buttons/toggle_style_configurations.dart @@ -1,6 +1,5 @@ // ignore_for_file: public_member_api_docs, sort_constructors_first import 'package:flutter/foundation.dart' show immutable; -import 'package:flutter/widgets.dart' show Color; import '../base_button_configurations.dart'; @@ -26,12 +25,9 @@ class QuillToolbarToggleStyleButtonOptions super.iconData, super.iconSize, super.iconButtonFactor, - this.fillColor, super.tooltip, super.afterButtonPressed, super.iconTheme, super.childBuilder, }); - - final Color? fillColor; } diff --git a/lib/src/models/themes/quill_icon_theme.dart b/lib/src/models/themes/quill_icon_theme.dart index 68983d66..9dedee8b 100644 --- a/lib/src/models/themes/quill_icon_theme.dart +++ b/lib/src/models/themes/quill_icon_theme.dart @@ -4,17 +4,10 @@ import 'package:flutter/material.dart'; @immutable class QuillIconTheme { const QuillIconTheme({ - this.iconButtonSelectedStyle, - this.iconButtonUnselectedStyle, this.iconButtonSelectedData, this.iconButtonUnselectedData, }); - @Deprecated('Please use iconButtonUnselectedData instead') - final ButtonStyle? iconButtonUnselectedStyle; - @Deprecated('Please use iconButtonSelectedData instead') - final ButtonStyle? iconButtonSelectedStyle; - final IconButtonData? iconButtonUnselectedData; final IconButtonData? iconButtonSelectedData; diff --git a/lib/src/widgets/toolbar/buttons/toggle_check_list_button.dart b/lib/src/widgets/toolbar/buttons/toggle_check_list_button.dart index 46bcf7e1..83679798 100644 --- a/lib/src/widgets/toolbar/buttons/toggle_check_list_button.dart +++ b/lib/src/widgets/toolbar/buttons/toggle_check_list_button.dart @@ -146,7 +146,6 @@ class QuillToolbarToggleCheckListButtonState context, Attribute.unchecked, iconData, - options.fillColor, _isToggled, _toggleAttribute, afterButtonPressed, diff --git a/lib/src/widgets/toolbar/buttons/toggle_style_button.dart b/lib/src/widgets/toolbar/buttons/toggle_style_button.dart index f93e79a1..6447bffd 100644 --- a/lib/src/widgets/toolbar/buttons/toggle_style_button.dart +++ b/lib/src/widgets/toolbar/buttons/toggle_style_button.dart @@ -13,7 +13,6 @@ typedef ToggleStyleButtonBuilder = Widget Function( BuildContext context, Attribute attribute, IconData icon, - Color? fillColor, bool? isToggled, VoidCallback? onPressed, VoidCallback? afterPressed, [ @@ -172,7 +171,6 @@ class QuillToolbarToggleStyleButtonState context, widget.attribute, iconData, - options.fillColor, _isToggled, _toggleAttribute, afterButtonPressed, @@ -231,7 +229,6 @@ Widget defaultToggleStyleButtonBuilder( BuildContext context, Attribute attribute, IconData icon, - Color? fillColor, bool? isToggled, VoidCallback? onPressed, VoidCallback? afterPressed, [ From 5329c886054c74a7b7ef5ab6e3327fc666221f50 Mon Sep 17 00:00:00 2001 From: coolswood Date: Mon, 22 Apr 2024 03:49:32 +0300 Subject: [PATCH 02/10] fix: added missed translations for ru, es, de (#1826) --- .../generated/quill_localizations_de.dart | 27 ++-- .../generated/quill_localizations_es.dart | 97 +++++++------- .../generated/quill_localizations_ru.dart | 122 +++++++++--------- lib/src/l10n/quill_de.arb | 22 ++-- lib/src/l10n/quill_es.arb | 96 +++++++------- lib/src/l10n/quill_ru.arb | 119 +++++++++-------- lib/src/l10n/untranslated.json | 10 -- 7 files changed, 249 insertions(+), 244 deletions(-) diff --git a/lib/src/l10n/generated/quill_localizations_de.dart b/lib/src/l10n/generated/quill_localizations_de.dart index 4b6a4424..ea60468d 100644 --- a/lib/src/l10n/generated/quill_localizations_de.dart +++ b/lib/src/l10n/generated/quill_localizations_de.dart @@ -215,10 +215,10 @@ class FlutterQuillLocalizationsDe extends FlutterQuillLocalizations { String get moveToNextOccurrence => 'Zum nächsten Auftreten springen'; @override - String get savedUsingTheNetwork => 'Saved using the network'; + String get savedUsingTheNetwork => 'Mit dem Netzwerk gespeichert'; @override - String get savedUsingLocalStorage => 'Saved using the local storage'; + String get savedUsingLocalStorage => 'Mit dem lokalen Speicher gespeichert'; @override String theImageHasBeenSavedAt(String imagePath) { @@ -226,16 +226,17 @@ class FlutterQuillLocalizationsDe extends FlutterQuillLocalizations { } @override - String get errorWhileSavingImage => 'Error while saving image'; + String get errorWhileSavingImage => 'Fehler beim Speichern des Bildes'; @override - String get pleaseEnterTextForYourLink => "e.g., 'Learn more'"; + String get pleaseEnterTextForYourLink => "z.B. 'Mehr erfahren'"; @override - String get pleaseEnterTheLinkURL => "e.g., 'https://example.com'"; + String get pleaseEnterTheLinkURL => "z.B. 'https://example.com'"; @override - String get pleaseEnterAValidImageURL => 'Please enter a valid image URL'; + String get pleaseEnterAValidImageURL => + 'Bitte geben Sie eine gültige Bild-URL ein'; @override String get pleaseEnterAValidVideoURL => @@ -255,19 +256,23 @@ class FlutterQuillLocalizationsDe extends FlutterQuillLocalizations { String get insertImage => 'Bild einfügen'; @override - String get pickAPhotoFromYourGallery => 'Pick a photo from your gallery'; + String get pickAPhotoFromYourGallery => + 'Wählen Sie ein Foto aus Ihrer Galerie'; @override - String get takeAPhotoUsingYourCamera => 'Take a photo using your camera'; + String get takeAPhotoUsingYourCamera => + 'Machen Sie ein Foto mit Ihrer Kamera'; @override - String get pasteAPhotoUsingALink => 'Paste a photo using a link'; + String get pasteAPhotoUsingALink => 'Fügen Sie ein Foto über einen Link ein'; @override - String get pickAVideoFromYourGallery => 'Pick a video from your gallery'; + String get pickAVideoFromYourGallery => + 'Wählen Sie ein Video aus Ihrer Galerie'; @override - String get recordAVideoUsingYourCamera => 'Record a video using your camera'; + String get recordAVideoUsingYourCamera => + 'Nehmen Sie ein Video mit Ihrer Kamera auf'; @override String get pasteAVideoUsingALink => 'Paste a video using a link'; diff --git a/lib/src/l10n/generated/quill_localizations_es.dart b/lib/src/l10n/generated/quill_localizations_es.dart index 550cc74e..2879c8ee 100644 --- a/lib/src/l10n/generated/quill_localizations_es.dart +++ b/lib/src/l10n/generated/quill_localizations_es.dart @@ -77,64 +77,64 @@ class FlutterQuillLocalizationsEs extends FlutterQuillLocalizations { String get video => 'Vídeo'; @override - String get undo => 'Undo'; + String get undo => 'Deshacer'; @override - String get redo => 'Redo'; + String get redo => 'Rehacer'; @override - String get fontFamily => 'Font family'; + String get fontFamily => 'Familia de fuentes'; @override - String get fontSize => 'Font size'; + String get fontSize => 'Tamaño de fuente'; @override - String get bold => 'Bold'; + String get bold => 'Negrita'; @override - String get subscript => 'Subscript'; + String get subscript => 'Subíndice'; @override - String get superscript => 'Superscript'; + String get superscript => 'Superíndice'; @override - String get italic => 'Italic'; + String get italic => 'Cursiva'; @override - String get underline => 'Underline'; + String get underline => 'Subrayado'; @override - String get strikeThrough => 'Strike through'; + String get strikeThrough => 'Tachado'; @override - String get inlineCode => 'Inline code'; + String get inlineCode => 'Código en línea'; @override - String get fontColor => 'Font color'; + String get fontColor => 'Color de fuente'; @override - String get backgroundColor => 'Background color'; + String get backgroundColor => 'Color de fondo'; @override - String get clearFormat => 'Clear format'; + String get clearFormat => 'Quitar formato'; @override - String get alignLeft => 'Align left'; + String get alignLeft => 'Alinear a la izquierda'; @override - String get alignCenter => 'Align center'; + String get alignCenter => 'Centrar'; @override - String get alignRight => 'Align right'; + String get alignRight => 'Alinear a la derecha'; @override - String get justifyWinWidth => 'Justify win width'; + String get justifyWinWidth => 'Justificar'; @override - String get textDirection => 'Text direction'; + String get textDirection => 'Dirección del texto'; @override - String get headerStyle => 'Header style'; + String get headerStyle => 'Estilo de encabezado'; @override String get normal => 'Normal'; @@ -158,43 +158,43 @@ class FlutterQuillLocalizationsEs extends FlutterQuillLocalizations { String get heading6 => 'Heading 6'; @override - String get numberedList => 'Numbered list'; + String get numberedList => 'Lista numerada'; @override - String get bulletList => 'Bullet list'; + String get bulletList => 'Lista con viñetas'; @override - String get checkedList => 'Checked list'; + String get checkedList => 'Lista de comprobación'; @override - String get codeBlock => 'Code block'; + String get codeBlock => 'Bloque de código'; @override - String get quote => 'Quote'; + String get quote => 'Cita'; @override - String get increaseIndent => 'Increase indent'; + String get increaseIndent => 'Aumentar sangría'; @override - String get decreaseIndent => 'Decrease indent'; + String get decreaseIndent => 'Disminuir sangría'; @override - String get insertURL => 'Insert URL'; + String get insertURL => 'Insertar URL'; @override - String get visitLink => 'Visit link'; + String get visitLink => 'Visitar enlace'; @override - String get enterLink => 'Enter link'; + String get enterLink => 'Introducir enlace'; @override - String get enterMedia => 'Enter media'; + String get enterMedia => 'Insertar medio'; @override - String get edit => 'Edit'; + String get edit => 'Editar'; @override - String get apply => 'Apply'; + String get apply => 'Aplicar'; @override String get hex => 'Hex'; @@ -206,19 +206,19 @@ class FlutterQuillLocalizationsEs extends FlutterQuillLocalizations { String get color => 'Color'; @override - String get findText => 'Find text'; + String get findText => 'Buscar texto'; @override - String get moveToPreviousOccurrence => 'Move to previous occurrence'; + String get moveToPreviousOccurrence => 'Ir a la ocurrencia anterior'; @override - String get moveToNextOccurrence => 'Move to next occurrence'; + String get moveToNextOccurrence => 'Ir a la siguiente ocurrencia'; @override - String get savedUsingTheNetwork => 'Saved using the network'; + String get savedUsingTheNetwork => 'Guardado usando la red'; @override - String get savedUsingLocalStorage => 'Saved using the local storage'; + String get savedUsingLocalStorage => 'Guardado usando almacenamiento local'; @override String theImageHasBeenSavedAt(String imagePath) { @@ -226,16 +226,17 @@ class FlutterQuillLocalizationsEs extends FlutterQuillLocalizations { } @override - String get errorWhileSavingImage => 'Error while saving image'; + String get errorWhileSavingImage => 'Error al guardar imagen'; @override - String get pleaseEnterTextForYourLink => "e.g., 'Learn more'"; + String get pleaseEnterTextForYourLink => "p.ej., 'Aprende más'"; @override - String get pleaseEnterTheLinkURL => "e.g., 'https://example.com'"; + String get pleaseEnterTheLinkURL => "p.ej., 'https://example.com'"; @override - String get pleaseEnterAValidImageURL => 'Please enter a valid image URL'; + String get pleaseEnterAValidImageURL => + 'Por favor, introduzca una URL de imagen válida'; @override String get pleaseEnterAValidVideoURL => @@ -249,25 +250,25 @@ class FlutterQuillLocalizationsEs extends FlutterQuillLocalizations { @override String get caseSensitivityAndWholeWordSearch => - 'Sensibilidad a mayúsculas y minúsculas y búsqueda de palabras completas'; + 'Sensibilidad a mayúsculas y búsqueda de palabras completas'; @override String get insertImage => 'Insertar imagen'; @override - String get pickAPhotoFromYourGallery => 'Pick a photo from your gallery'; + String get pickAPhotoFromYourGallery => 'Elige una foto de tu galería'; @override - String get takeAPhotoUsingYourCamera => 'Take a photo using your camera'; + String get takeAPhotoUsingYourCamera => 'Toma una foto con tu cámara'; @override - String get pasteAPhotoUsingALink => 'Paste a photo using a link'; + String get pasteAPhotoUsingALink => 'Pega una foto usando un enlace'; @override - String get pickAVideoFromYourGallery => 'Pick a video from your gallery'; + String get pickAVideoFromYourGallery => 'Elige un video de tu galería'; @override - String get recordAVideoUsingYourCamera => 'Record a video using your camera'; + String get recordAVideoUsingYourCamera => 'Graba un video con tu cámara'; @override String get pasteAVideoUsingALink => 'Paste a video using a link'; diff --git a/lib/src/l10n/generated/quill_localizations_ru.dart b/lib/src/l10n/generated/quill_localizations_ru.dart index 5866d587..277a0c9b 100644 --- a/lib/src/l10n/generated/quill_localizations_ru.dart +++ b/lib/src/l10n/generated/quill_localizations_ru.dart @@ -41,100 +41,100 @@ class FlutterQuillLocalizationsRu extends FlutterQuillLocalizations { String get text => 'Текст'; @override - String get resize => 'Resize'; + String get resize => 'Изменить размер'; @override - String get width => 'Width'; + String get width => 'Ширина'; @override - String get height => 'Height'; + String get height => 'Высота'; @override - String get size => 'Size'; + String get size => 'Размер'; @override - String get small => 'Small'; + String get small => 'Маленький'; @override - String get large => 'Large'; + String get large => 'Большой'; @override - String get huge => 'Huge'; + String get huge => 'Огромный'; @override - String get clear => 'Clear'; + String get clear => 'Очистить'; @override - String get font => 'Font'; + String get font => 'Шрифт'; @override - String get search => 'Search'; + String get search => 'Поиск'; @override - String get camera => 'Camera'; + String get camera => 'Камера'; @override - String get video => 'Video'; + String get video => 'Видео'; @override - String get undo => 'Undo'; + String get undo => 'Отменить'; @override - String get redo => 'Redo'; + String get redo => 'Повторить'; @override - String get fontFamily => 'Font family'; + String get fontFamily => 'Семейство шрифтов'; @override - String get fontSize => 'Font size'; + String get fontSize => 'Размер шрифта'; @override - String get bold => 'Bold'; + String get bold => 'Жирный'; @override - String get subscript => 'Subscript'; + String get subscript => 'Нижний индекс'; @override - String get superscript => 'Superscript'; + String get superscript => 'Верхний индекс'; @override - String get italic => 'Italic'; + String get italic => 'Курсив'; @override - String get underline => 'Underline'; + String get underline => 'Подчеркнутый'; @override - String get strikeThrough => 'Strike through'; + String get strikeThrough => 'Зачеркнутый'; @override - String get inlineCode => 'Inline code'; + String get inlineCode => 'Встроенный код'; @override - String get fontColor => 'Font color'; + String get fontColor => 'Цвет шрифта'; @override - String get backgroundColor => 'Background color'; + String get backgroundColor => 'Цвет фона'; @override - String get clearFormat => 'Clear format'; + String get clearFormat => 'Очистить форматирование'; @override - String get alignLeft => 'Align left'; + String get alignLeft => 'Выровнять по левому краю'; @override - String get alignCenter => 'Align center'; + String get alignCenter => 'Выровнять по центру'; @override - String get alignRight => 'Align right'; + String get alignRight => 'Выровнять по правому краю'; @override - String get justifyWinWidth => 'Justify win width'; + String get justifyWinWidth => 'Выровнять по ширине окна'; @override - String get textDirection => 'Text direction'; + String get textDirection => 'Направление текста'; @override - String get headerStyle => 'Header style'; + String get headerStyle => 'Стиль заголовка'; @override String get normal => 'Normal'; @@ -158,43 +158,43 @@ class FlutterQuillLocalizationsRu extends FlutterQuillLocalizations { String get heading6 => 'Heading 6'; @override - String get numberedList => 'Numbered list'; + String get numberedList => 'Нумерованный список'; @override - String get bulletList => 'Bullet list'; + String get bulletList => 'Маркированный список'; @override - String get checkedList => 'Checked list'; + String get checkedList => 'Список с галочками'; @override - String get codeBlock => 'Code block'; + String get codeBlock => 'Блок кода'; @override - String get quote => 'Quote'; + String get quote => 'Цитата'; @override - String get increaseIndent => 'Increase indent'; + String get increaseIndent => 'Увеличить отступ'; @override - String get decreaseIndent => 'Decrease indent'; + String get decreaseIndent => 'Уменьшить отступ'; @override - String get insertURL => 'Insert URL'; + String get insertURL => 'Вставить URL'; @override - String get visitLink => 'Visit link'; + String get visitLink => 'Посетить ссылку'; @override - String get enterLink => 'Enter link'; + String get enterLink => 'Введите ссылку'; @override - String get enterMedia => 'Enter media'; + String get enterMedia => 'Введите медиа'; @override - String get edit => 'Edit'; + String get edit => 'Редактировать'; @override - String get apply => 'Apply'; + String get apply => 'Применить'; @override String get hex => 'Hex'; @@ -206,19 +206,20 @@ class FlutterQuillLocalizationsRu extends FlutterQuillLocalizations { String get color => 'Цвет'; @override - String get findText => 'Find text'; + String get findText => 'Найти текст'; @override - String get moveToPreviousOccurrence => 'Move to previous occurrence'; + String get moveToPreviousOccurrence => 'Перейти к предыдущему вхождению'; @override - String get moveToNextOccurrence => 'Move to next occurrence'; + String get moveToNextOccurrence => 'Перейти к следующему вхождению'; @override - String get savedUsingTheNetwork => 'Saved using the network'; + String get savedUsingTheNetwork => 'Сохранено с использованием сети'; @override - String get savedUsingLocalStorage => 'Saved using the local storage'; + String get savedUsingLocalStorage => + 'Сохранено с использованием локального хранилища'; @override String theImageHasBeenSavedAt(String imagePath) { @@ -226,16 +227,17 @@ class FlutterQuillLocalizationsRu extends FlutterQuillLocalizations { } @override - String get errorWhileSavingImage => 'Error while saving image'; + String get errorWhileSavingImage => 'Ошибка при сохранении изображения'; @override - String get pleaseEnterTextForYourLink => "e.g., 'Learn more'"; + String get pleaseEnterTextForYourLink => "например, 'Узнать больше'"; @override - String get pleaseEnterTheLinkURL => "e.g., 'https://example.com'"; + String get pleaseEnterTheLinkURL => "например, 'https://example.com'"; @override - String get pleaseEnterAValidImageURL => 'Please enter a valid image URL'; + String get pleaseEnterAValidImageURL => + 'Пожалуйста, введите действительный URL изображения'; @override String get pleaseEnterAValidVideoURL => @@ -249,27 +251,27 @@ class FlutterQuillLocalizationsRu extends FlutterQuillLocalizations { @override String get caseSensitivityAndWholeWordSearch => - 'Чувствительность к регистру и поиск целых слов'; + 'Учет регистра и поиск по всему слову'; @override String get insertImage => 'Вставить изображение'; @override - String get pickAPhotoFromYourGallery => 'Выберите фотографю из вашей галереи'; + String get pickAPhotoFromYourGallery => + 'Выберите фотографию из вашей галереи'; @override String get takeAPhotoUsingYourCamera => - 'Создайте фотографю, использую фотокамеру'; + 'Сделайте фотографию, используя камеру'; @override String get pasteAPhotoUsingALink => 'Вставьте фотографию, используя ссылку'; @override - String get pickAVideoFromYourGallery => 'Выберете видео из вашей галереи'; + String get pickAVideoFromYourGallery => 'Выберите видео из вашей галереи'; @override - String get recordAVideoUsingYourCamera => - 'Запишите видео, используя вдеокамеру'; + String get recordAVideoUsingYourCamera => 'Запишите видео, используя камеру'; @override String get pasteAVideoUsingALink => 'Paste a video using a link'; diff --git a/lib/src/l10n/quill_de.arb b/lib/src/l10n/quill_de.arb index a8e080ef..d8409b3f 100644 --- a/lib/src/l10n/quill_de.arb +++ b/lib/src/l10n/quill_de.arb @@ -60,12 +60,12 @@ "findText": "Text suchen", "moveToPreviousOccurrence": "Zum vorherigen Auftreten springen", "moveToNextOccurrence": "Zum nächsten Auftreten springen", - "savedUsingTheNetwork": "Saved using the network", - "savedUsingLocalStorage": "Saved using the local storage", - "errorWhileSavingImage": "Error while saving image", - "pleaseEnterTextForYourLink": "e.g., 'Learn more'", - "pleaseEnterTheLinkURL": "e.g., 'https://example.com'", - "pleaseEnterAValidImageURL": "Please enter a valid image URL", + "savedUsingTheNetwork": "Mit dem Netzwerk gespeichert", + "savedUsingLocalStorage": "Mit dem lokalen Speicher gespeichert", + "errorWhileSavingImage": "Fehler beim Speichern des Bildes", + "pleaseEnterTextForYourLink": "z.B. 'Mehr erfahren'", + "pleaseEnterTheLinkURL": "z.B. 'https://example.com'", + "pleaseEnterAValidImageURL": "Bitte geben Sie eine gültige Bild-URL ein", "hex": "Hex", "material": "Material", "color": "Farbe", @@ -73,6 +73,10 @@ "photo": "Foto", "image": "Bild", "caseSensitivityAndWholeWordSearch": "Groß- und Kleinschreibung sowie Ganzwortsuche", - "insertImage": "Bild einfügen" - } - \ No newline at end of file + "insertImage": "Bild einfügen", + "pickAPhotoFromYourGallery": "Wählen Sie ein Foto aus Ihrer Galerie", + "takeAPhotoUsingYourCamera": "Machen Sie ein Foto mit Ihrer Kamera", + "pasteAPhotoUsingALink": "Fügen Sie ein Foto über einen Link ein", + "pickAVideoFromYourGallery": "Wählen Sie ein Video aus Ihrer Galerie", + "recordAVideoUsingYourCamera": "Nehmen Sie ein Video mit Ihrer Kamera auf" +} \ No newline at end of file diff --git a/lib/src/l10n/quill_es.arb b/lib/src/l10n/quill_es.arb index dd994f97..a6d3f612 100644 --- a/lib/src/l10n/quill_es.arb +++ b/lib/src/l10n/quill_es.arb @@ -24,55 +24,59 @@ "search": "Buscar", "camera": "Cámara", "video": "Vídeo", - "undo": "Undo", - "redo": "Redo", - "fontFamily": "Font family", - "fontSize": "Font size", - "bold": "Bold", - "subscript": "Subscript", - "superscript": "Superscript", - "italic": "Italic", - "underline": "Underline", - "strikeThrough": "Strike through", - "inlineCode": "Inline code", - "fontColor": "Font color", - "backgroundColor": "Background color", - "clearFormat": "Clear format", - "alignLeft": "Align left", - "alignCenter": "Align center", - "alignRight": "Align right", - "justifyWinWidth": "Justify win width", - "textDirection": "Text direction", - "headerStyle": "Header style", - "numberedList": "Numbered list", - "bulletList": "Bullet list", - "checkedList": "Checked list", - "codeBlock": "Code block", - "quote": "Quote", - "increaseIndent": "Increase indent", - "decreaseIndent": "Decrease indent", - "insertURL": "Insert URL", - "visitLink": "Visit link", - "enterLink": "Enter link", - "enterMedia": "Enter media", - "edit": "Edit", - "apply": "Apply", - "findText": "Find text", - "moveToPreviousOccurrence": "Move to previous occurrence", - "moveToNextOccurrence": "Move to next occurrence", - "savedUsingTheNetwork": "Saved using the network", - "savedUsingLocalStorage": "Saved using the local storage", - "errorWhileSavingImage": "Error while saving image", - "pleaseEnterTextForYourLink": "e.g., 'Learn more'", - "pleaseEnterTheLinkURL": "e.g., 'https://example.com'", - "pleaseEnterAValidImageURL": "Please enter a valid image URL", + "undo": "Deshacer", + "redo": "Rehacer", + "fontFamily": "Familia de fuentes", + "fontSize": "Tamaño de fuente", + "bold": "Negrita", + "subscript": "Subíndice", + "superscript": "Superíndice", + "italic": "Cursiva", + "underline": "Subrayado", + "strikeThrough": "Tachado", + "inlineCode": "Código en línea", + "fontColor": "Color de fuente", + "backgroundColor": "Color de fondo", + "clearFormat": "Quitar formato", + "alignLeft": "Alinear a la izquierda", + "alignCenter": "Centrar", + "alignRight": "Alinear a la derecha", + "justifyWinWidth": "Justificar", + "textDirection": "Dirección del texto", + "headerStyle": "Estilo de encabezado", + "numberedList": "Lista numerada", + "bulletList": "Lista con viñetas", + "checkedList": "Lista de comprobación", + "codeBlock": "Bloque de código", + "quote": "Cita", + "increaseIndent": "Aumentar sangría", + "decreaseIndent": "Disminuir sangría", + "insertURL": "Insertar URL", + "visitLink": "Visitar enlace", + "enterLink": "Introducir enlace", + "enterMedia": "Insertar medio", + "edit": "Editar", + "apply": "Aplicar", + "findText": "Buscar texto", + "moveToPreviousOccurrence": "Ir a la ocurrencia anterior", + "moveToNextOccurrence": "Ir a la siguiente ocurrencia", + "savedUsingTheNetwork": "Guardado usando la red", + "savedUsingLocalStorage": "Guardado usando almacenamiento local", + "errorWhileSavingImage": "Error al guardar imagen", + "pleaseEnterTextForYourLink": "p.ej., 'Aprende más'", + "pleaseEnterTheLinkURL": "p.ej., 'https://example.com'", + "pleaseEnterAValidImageURL": "Por favor, introduzca una URL de imagen válida", "hex": "Hex", "material": "Material", "color": "Color", "pleaseEnterAValidVideoURL": "Por favor, ingrese una URL de video válida", "photo": "Foto", "image": "Imagen", - "caseSensitivityAndWholeWordSearch": "Sensibilidad a mayúsculas y minúsculas y búsqueda de palabras completas", - "insertImage": "Insertar imagen" - } - \ No newline at end of file + "caseSensitivityAndWholeWordSearch": "Sensibilidad a mayúsculas y búsqueda de palabras completas", + "insertImage": "Insertar imagen", + "pickAPhotoFromYourGallery": "Elige una foto de tu galería", + "takeAPhotoUsingYourCamera": "Toma una foto con tu cámara", + "pasteAPhotoUsingALink": "Pega una foto usando un enlace", + "pickAVideoFromYourGallery": "Elige un video de tu galería", + "recordAVideoUsingYourCamera": "Graba un video con tu cámara" +} \ No newline at end of file diff --git a/lib/src/l10n/quill_ru.arb b/lib/src/l10n/quill_ru.arb index 15221822..a65d8b24 100644 --- a/lib/src/l10n/quill_ru.arb +++ b/lib/src/l10n/quill_ru.arb @@ -12,72 +12,71 @@ "zoom": "Увеличить", "saved": "Сохранено", "text": "Текст", - "resize": "Resize", - "width": "Width", - "height": "Height", - "size": "Size", - "small": "Small", - "large": "Large", - "huge": "Huge", - "clear": "Clear", - "font": "Font", - "search": "Search", - "camera": "Camera", - "video": "Video", - "undo": "Undo", - "redo": "Redo", - "fontFamily": "Font family", - "fontSize": "Font size", - "bold": "Bold", - "subscript": "Subscript", - "superscript": "Superscript", - "italic": "Italic", - "underline": "Underline", - "strikeThrough": "Strike through", - "inlineCode": "Inline code", - "fontColor": "Font color", - "backgroundColor": "Background color", - "clearFormat": "Clear format", - "alignLeft": "Align left", - "alignCenter": "Align center", - "alignRight": "Align right", - "justifyWinWidth": "Justify win width", - "textDirection": "Text direction", - "headerStyle": "Header style", - "numberedList": "Numbered list", - "bulletList": "Bullet list", - "checkedList": "Checked list", - "codeBlock": "Code block", - "quote": "Quote", - "increaseIndent": "Increase indent", - "decreaseIndent": "Decrease indent", - "insertURL": "Insert URL", - "visitLink": "Visit link", - "enterLink": "Enter link", - "enterMedia": "Enter media", - "edit": "Edit", - "apply": "Apply", - "findText": "Find text", - "moveToPreviousOccurrence": "Move to previous occurrence", - "moveToNextOccurrence": "Move to next occurrence", - "savedUsingTheNetwork": "Saved using the network", - "savedUsingLocalStorage": "Saved using the local storage", - "errorWhileSavingImage": "Error while saving image", - "pleaseEnterTextForYourLink": "e.g., 'Learn more'", - "pleaseEnterTheLinkURL": "e.g., 'https://example.com'", - "pleaseEnterAValidImageURL": "Please enter a valid image URL", + "resize": "Изменить размер", + "width": "Ширина", + "height": "Высота", + "size": "Размер", + "small": "Маленький", + "large": "Большой", + "huge": "Огромный", + "clear": "Очистить", + "font": "Шрифт", + "search": "Поиск", + "camera": "Камера", + "video": "Видео", + "undo": "Отменить", + "redo": "Повторить", + "fontFamily": "Семейство шрифтов", + "fontSize": "Размер шрифта", + "bold": "Жирный", + "subscript": "Нижний индекс", + "superscript": "Верхний индекс", + "italic": "Курсив", + "underline": "Подчеркнутый", + "strikeThrough": "Зачеркнутый", + "inlineCode": "Встроенный код", + "fontColor": "Цвет шрифта", + "backgroundColor": "Цвет фона", + "clearFormat": "Очистить форматирование", + "alignLeft": "Выровнять по левому краю", + "alignCenter": "Выровнять по центру", + "alignRight": "Выровнять по правому краю", + "justifyWinWidth": "Выровнять по ширине окна", + "textDirection": "Направление текста", + "headerStyle": "Стиль заголовка", + "numberedList": "Нумерованный список", + "bulletList": "Маркированный список", + "checkedList": "Список с галочками", + "codeBlock": "Блок кода", + "quote": "Цитата", + "increaseIndent": "Увеличить отступ", + "decreaseIndent": "Уменьшить отступ", + "insertURL": "Вставить URL", + "visitLink": "Посетить ссылку", + "enterLink": "Введите ссылку", + "enterMedia": "Введите медиа", + "edit": "Редактировать", + "apply": "Применить", + "findText": "Найти текст", + "moveToPreviousOccurrence": "Перейти к предыдущему вхождению", + "moveToNextOccurrence": "Перейти к следующему вхождению", + "savedUsingTheNetwork": "Сохранено с использованием сети", + "savedUsingLocalStorage": "Сохранено с использованием локального хранилища", + "errorWhileSavingImage": "Ошибка при сохранении изображения", + "pleaseEnterTextForYourLink": "например, 'Узнать больше'", + "pleaseEnterTheLinkURL": "например, 'https://example.com'", + "pleaseEnterAValidImageURL": "Пожалуйста, введите действительный URL изображения", "hex": "Hex", "material": "Материал", "color": "Цвет", "pleaseEnterAValidVideoURL": "Пожалуйста, введите действительный URL-адрес видео", "photo": "Фото", "image": "Изображение", - "caseSensitivityAndWholeWordSearch": "Чувствительность к регистру и поиск целых слов", + "caseSensitivityAndWholeWordSearch": "Учет регистра и поиск по всему слову", "insertImage": "Вставить изображение", - "pickAPhotoFromYourGallery": "Выберите фотографю из вашей галереи", - "takeAPhotoUsingYourCamera": "Создайте фотографю, использую фотокамеру", + "pickAPhotoFromYourGallery": "Выберите фотографию из вашей галереи", + "takeAPhotoUsingYourCamera": "Сделайте фотографию, используя камеру", "pasteAPhotoUsingALink": "Вставьте фотографию, используя ссылку", - "pickAVideoFromYourGallery": "Выберете видео из вашей галереи", - "recordAVideoUsingYourCamera": "Запишите видео, используя вдеокамеру" + "pickAVideoFromYourGallery": "Выберите видео из вашей галереи", + "recordAVideoUsingYourCamera": "Запишите видео, используя камеру" } - \ No newline at end of file diff --git a/lib/src/l10n/untranslated.json b/lib/src/l10n/untranslated.json index b3601468..f177cacd 100644 --- a/lib/src/l10n/untranslated.json +++ b/lib/src/l10n/untranslated.json @@ -63,11 +63,6 @@ "heading5", "heading6", "theImageHasBeenSavedAt", - "pickAPhotoFromYourGallery", - "takeAPhotoUsingYourCamera", - "pasteAPhotoUsingALink", - "pickAVideoFromYourGallery", - "recordAVideoUsingYourCamera", "pasteAVideoUsingALink" ], @@ -97,11 +92,6 @@ "heading5", "heading6", "theImageHasBeenSavedAt", - "pickAPhotoFromYourGallery", - "takeAPhotoUsingYourCamera", - "pasteAPhotoUsingALink", - "pickAVideoFromYourGallery", - "recordAVideoUsingYourCamera", "pasteAVideoUsingALink" ], From 94a65f9a11a13aeed2c2efde989f109dc3a2e8de Mon Sep 17 00:00:00 2001 From: Sangam Singh <66767187+codersangam@users.noreply.github.com> Date: Wed, 24 Apr 2024 20:38:30 +0400 Subject: [PATCH 03/10] added translations for Nepali Locale('ne', 'NP') (#1830) --- .../l10n/generated/quill_localizations.dart | 5 + .../generated/quill_localizations_ne.dart | 279 ++++++++++++++++++ lib/src/l10n/quill_ne.arb | 100 +++++++ 3 files changed, 384 insertions(+) create mode 100644 lib/src/l10n/generated/quill_localizations_ne.dart create mode 100644 lib/src/l10n/quill_ne.arb diff --git a/lib/src/l10n/generated/quill_localizations.dart b/lib/src/l10n/generated/quill_localizations.dart index 08cf5bce..62c9b8f4 100644 --- a/lib/src/l10n/generated/quill_localizations.dart +++ b/lib/src/l10n/generated/quill_localizations.dart @@ -23,6 +23,7 @@ import 'quill_localizations_ja.dart'; import 'quill_localizations_ko.dart'; import 'quill_localizations_ku.dart'; import 'quill_localizations_ms.dart'; +import 'quill_localizations_ne.dart'; import 'quill_localizations_nl.dart'; import 'quill_localizations_no.dart'; import 'quill_localizations_pl.dart'; @@ -145,6 +146,7 @@ abstract class FlutterQuillLocalizations { Locale('ku'), Locale('ku', 'CKB'), Locale('ms'), + Locale('ne'), Locale('nl'), Locale('no'), Locale('pl'), @@ -726,6 +728,7 @@ class _FlutterQuillLocalizationsDelegate 'ko', 'ku', 'ms', + 'ne', 'nl', 'no', 'pl', @@ -833,6 +836,8 @@ FlutterQuillLocalizations lookupFlutterQuillLocalizations(Locale locale) { return FlutterQuillLocalizationsKu(); case 'ms': return FlutterQuillLocalizationsMs(); + case 'ne': + return FlutterQuillLocalizationsNe(); case 'nl': return FlutterQuillLocalizationsNl(); case 'no': diff --git a/lib/src/l10n/generated/quill_localizations_ne.dart b/lib/src/l10n/generated/quill_localizations_ne.dart new file mode 100644 index 00000000..9c460f33 --- /dev/null +++ b/lib/src/l10n/generated/quill_localizations_ne.dart @@ -0,0 +1,279 @@ +import 'quill_localizations.dart'; + +/// The translations for Nepali (`ne`). +class FlutterQuillLocalizationsNe extends FlutterQuillLocalizations { + FlutterQuillLocalizationsNe([super.locale = 'ne']); + + @override + String get pasteLink => 'लिङ्क पेस्ट गर्नुहोस्'; + + @override + String get ok => 'ठिक छ'; + + @override + String get selectColor => 'रंग छान्नुहोस्'; + + @override + String get gallery => 'ग्यालेरी'; + + @override + String get link => 'लिङ्क'; + + @override + String get open => 'खोल्नुहोस्'; + + @override + String get copy => 'कापी'; + + @override + String get remove => 'हटाउनुहोस्'; + + @override + String get save => 'सेभ'; + + @override + String get zoom => 'जुम गर्नुहोस्'; + + @override + String get saved => 'सेभ गरियो'; + + @override + String get text => 'टेक्स्ट'; + + @override + String get resize => 'आकार परिवर्तन गर्नुहोस्'; + + @override + String get width => 'चौडाइ'; + + @override + String get height => 'उचाइ'; + + @override + String get size => 'आकार'; + + @override + String get small => 'सानो'; + + @override + String get large => 'ठूलो'; + + @override + String get huge => 'विशाल'; + + @override + String get clear => 'खाली गर्नुहोस्'; + + @override + String get font => 'फन्ट'; + + @override + String get search => 'खोज'; + + @override + String get camera => 'क्यामेरा'; + + @override + String get video => 'भिडियो'; + + @override + String get undo => 'पूर्ववत गर्नुहोस्'; + + @override + String get redo => 'पुनः गर्नुहोस्'; + + @override + String get fontFamily => 'फन्ट परिवार'; + + @override + String get fontSize => 'फन्ट साइज'; + + @override + String get bold => 'बोल्ड'; + + @override + String get subscript => 'सदस्यता'; + + @override + String get superscript => 'सुपरलिपि'; + + @override + String get italic => 'इटालिक'; + + @override + String get underline => 'रेखाङ्कन गर्नुहोस्'; + + @override + String get strikeThrough => 'मार्फत स्ट्राइक'; + + @override + String get inlineCode => 'इनलाईन कोड'; + + @override + String get fontColor => 'फन्टको रंग'; + + @override + String get backgroundColor => 'पृष्ठभूमि रङ'; + + @override + String get clearFormat => 'ढाँचा खाली गर्नुहोस्'; + + @override + String get alignLeft => 'बायाँ पङ्क्तिबद्ध'; + + @override + String get alignCenter => 'केन्द्र पङ्क्तिबद्ध'; + + @override + String get alignRight => 'दायाँ पङ्क्तिबद्ध'; + + @override + String get justifyWinWidth => 'जस्टीफ़ी विन चौड़ाई'; + + @override + String get textDirection => 'टेक्स्ट दिशा'; + + @override + String get headerStyle => 'हेडर शैली'; + + @override + String get normal => 'सामान्य'; + + @override + String get heading1 => 'हेडिङ १'; + + @override + String get heading2 => 'हेडिङ २'; + + @override + String get heading3 => 'हेडिङ ३'; + + @override + String get heading4 => 'हेडिङ ४'; + + @override + String get heading5 => 'हेडिङ ५'; + + @override + String get heading6 => 'हेडिङ ६'; + + @override + String get numberedList => 'अंकित सूची'; + + @override + String get bulletList => 'बुलेट सूची'; + + @override + String get checkedList => 'चेक सूची'; + + @override + String get codeBlock => 'कोड ब्लक'; + + @override + String get quote => 'उद्धरण'; + + @override + String get increaseIndent => 'इन्डेन्ट बढाउनुहोस्'; + + @override + String get decreaseIndent => 'इन्डेन्ट घटाउनुहोस्'; + + @override + String get insertURL => 'URL सम्मिलित गर्नुहोस्'; + + @override + String get visitLink => 'लिङ्कमा जानुहोस्'; + + @override + String get enterLink => 'लिङ्क प्रविष्ट गर्नुहोस्'; + + @override + String get enterMedia => 'मिडिया प्रविष्ट गर्नुहोस्'; + + @override + String get edit => 'सम्पादन गर्नुहोस्'; + + @override + String get apply => 'लागू'; + + @override + String get hex => 'Hex'; + + @override + String get material => 'Material'; + + @override + String get color => 'रङ'; + + @override + String get findText => 'टेक्स्ट फेला पार्नुहोस्'; + + @override + String get moveToPreviousOccurrence => 'अघिल्लो घटनामा जानुहोस्'; + + @override + String get moveToNextOccurrence => 'अर्को घटनामा सार्नुहोस्'; + + @override + String get savedUsingTheNetwork => 'नेटवर्क प्रयोग गरेर बचत गरियो'; + + @override + String get savedUsingLocalStorage => 'स्थानीय भण्डारण प्रयोग गरेर बचत गरियो'; + + @override + String theImageHasBeenSavedAt(String imagePath) { + return 'तस्बिर यहाँ सुरक्षित गरिएको छ: $imagePath'; + } + + @override + String get errorWhileSavingImage => 'तस्बिर सुरक्षित गर्दा त्रुटि भयो'; + + @override + String get pleaseEnterTextForYourLink => + "कृपया आफ्नो लिङ्कको लागि पाठ प्रविष्ट गर्नुहोस् (जस्तै, 'थप जान्नुहोस्')"; + + @override + String get pleaseEnterTheLinkURL => + "कृपया लिङ्क URL प्रविष्ट गर्नुहोस् (जस्तै, 'https://example.com')"; + + @override + String get pleaseEnterAValidImageURL => + 'कृपया वैध छवि URL प्रविष्ट गर्नुहोस्'; + + @override + String get pleaseEnterAValidVideoURL => + 'कृपया एउटा मान्य भिडियो url प्रविष्ट गर्नुहोस्'; + + @override + String get photo => 'फोटो'; + + @override + String get image => 'तस्बिर'; + + @override + String get caseSensitivityAndWholeWordSearch => + 'केस संवेदनशीलता र सम्पूर्ण शब्द खोज'; + + @override + String get insertImage => 'छवि सम्मिलित गर्नुहोस्'; + + @override + String get pickAPhotoFromYourGallery => 'आफ्नो ग्यालरीबाट फोटो छान्नुहोस्'; + + @override + String get takeAPhotoUsingYourCamera => + 'आफ्नो क्यामेरा प्रयोग गरेर फोटो खिच्नुहोस्'; + + @override + String get pasteAPhotoUsingALink => 'लिङ्क प्रयोग गरेर फोटो टाँस्नुहोस्'; + + @override + String get pickAVideoFromYourGallery => 'आफ्नो ग्यालरीबाट भिडियो छान्नुहोस्'; + + @override + String get recordAVideoUsingYourCamera => + 'आफ्नो क्यामेरा प्रयोग गरेर भिडियो रेकर्ड गर्नुहोस्'; + + @override + String get pasteAVideoUsingALink => 'लिङ्क प्रयोग गरेर भिडियो टाँस्नुहोस्'; +} diff --git a/lib/src/l10n/quill_ne.arb b/lib/src/l10n/quill_ne.arb new file mode 100644 index 00000000..f7cb56dd --- /dev/null +++ b/lib/src/l10n/quill_ne.arb @@ -0,0 +1,100 @@ +{ + "@@locale": "ne", + "pasteLink": "लिङ्क पेस्ट गर्नुहोस्", + "ok": "ठिक छ", + "selectColor": "रंग छान्नुहोस्", + "gallery": "ग्यालेरी", + "link": "लिङ्क", + "open": "खोल्नुहोस्", + "copy": "कापी", + "remove": "हटाउनुहोस्", + "save": "सेभ", + "zoom": "जुम गर्नुहोस्", + "saved": "सेभ गरियो", + "text": "टेक्स्ट", + "resize": "आकार परिवर्तन गर्नुहोस्", + "width": "चौडाइ", + "height": "उचाइ", + "size": "आकार", + "small": "सानो", + "large": "ठूलो", + "huge": "विशाल", + "clear": "खाली गर्नुहोस्", + "font": "फन्ट", + "search": "खोज", + "camera": "क्यामेरा", + "video": "भिडियो", + "undo": "पूर्ववत गर्नुहोस्", + "redo": "पुनः गर्नुहोस्", + "fontFamily": "फन्ट परिवार", + "fontSize": "फन्ट साइज", + "bold": "बोल्ड", + "subscript": "सदस्यता", + "superscript": "सुपरलिपि", + "italic": "इटालिक", + "underline": "रेखाङ्कन गर्नुहोस्", + "strikeThrough": "मार्फत स्ट्राइक", + "inlineCode": "इनलाईन कोड", + "fontColor": "फन्टको रंग", + "backgroundColor": "पृष्ठभूमि रङ", + "clearFormat": "ढाँचा खाली गर्नुहोस्", + "alignLeft": "बायाँ पङ्क्तिबद्ध", + "alignCenter": "केन्द्र पङ्क्तिबद्ध", + "alignRight": "दायाँ पङ्क्तिबद्ध", + "justifyWinWidth": "जस्टीफ़ी विन चौड़ाई", + "textDirection": "टेक्स्ट दिशा", + "headerStyle": "हेडर शैली", + "normal": "सामान्य", + "heading1": "हेडिङ १", + "heading2": "हेडिङ २", + "heading3": "हेडिङ ३", + "heading4": "हेडिङ ४", + "heading5": "हेडिङ ५", + "heading6": "हेडिङ ६", + "numberedList": "अंकित सूची", + "bulletList": "बुलेट सूची", + "checkedList": "चेक सूची", + "codeBlock": "कोड ब्लक", + "quote": "उद्धरण", + "increaseIndent": "इन्डेन्ट बढाउनुहोस्", + "decreaseIndent": "इन्डेन्ट घटाउनुहोस्", + "insertURL": "URL सम्मिलित गर्नुहोस्", + "visitLink": "लिङ्कमा जानुहोस्", + "enterLink": "लिङ्क प्रविष्ट गर्नुहोस्", + "enterMedia": "मिडिया प्रविष्ट गर्नुहोस्", + "edit": "सम्पादन गर्नुहोस्", + "apply": "लागू", + "hex": "Hex", + "material": "Material", + "color": "रङ", + "findText": "टेक्स्ट फेला पार्नुहोस्", + "moveToPreviousOccurrence": "अघिल्लो घटनामा जानुहोस्", + "moveToNextOccurrence": "अर्को घटनामा सार्नुहोस्", + "savedUsingTheNetwork": "नेटवर्क प्रयोग गरेर बचत गरियो", + "savedUsingLocalStorage": "स्थानीय भण्डारण प्रयोग गरेर बचत गरियो", + "theImageHasBeenSavedAt": "तस्बिर यहाँ सुरक्षित गरिएको छ: {imagePath}", + "@theImageHasBeenSavedAt": { + "description": "A message with a single parameter", + "placeholders": { + "imagePath": { + "type": "String", + "example": "path/to/location" + } + } + }, + "errorWhileSavingImage": "तस्बिर सुरक्षित गर्दा त्रुटि भयो", + "pleaseEnterTextForYourLink": "कृपया आफ्नो लिङ्कको लागि पाठ प्रविष्ट गर्नुहोस् (जस्तै, 'थप जान्नुहोस्')", + "pleaseEnterTheLinkURL": "कृपया लिङ्क URL प्रविष्ट गर्नुहोस् (जस्तै, 'https://example.com')", + "pleaseEnterAValidImageURL": "कृपया वैध छवि URL प्रविष्ट गर्नुहोस्", + "pleaseEnterAValidVideoURL": "कृपया एउटा मान्य भिडियो url प्रविष्ट गर्नुहोस्", + "photo": "फोटो", + "image": "तस्बिर", + "caseSensitivityAndWholeWordSearch": "केस संवेदनशीलता र सम्पूर्ण शब्द खोज", + "insertImage": "छवि सम्मिलित गर्नुहोस्", + "pickAPhotoFromYourGallery": "आफ्नो ग्यालरीबाट फोटो छान्नुहोस्", + "takeAPhotoUsingYourCamera": "आफ्नो क्यामेरा प्रयोग गरेर फोटो खिच्नुहोस्", + "pasteAPhotoUsingALink": "लिङ्क प्रयोग गरेर फोटो टाँस्नुहोस्", + "pickAVideoFromYourGallery": "आफ्नो ग्यालरीबाट भिडियो छान्नुहोस्", + "recordAVideoUsingYourCamera": "आफ्नो क्यामेरा प्रयोग गरेर भिडियो रेकर्ड गर्नुहोस्", + "pasteAVideoUsingALink": "लिङ्क प्रयोग गरेर भिडियो टाँस्नुहोस्" +} \ No newline at end of file From 3915213b97917b54eda969582ad47d00e4cfd446 Mon Sep 17 00:00:00 2001 From: X Code Date: Wed, 24 Apr 2024 09:43:05 -0700 Subject: [PATCH 04/10] Update translation.md --- doc/translation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/translation.md b/doc/translation.md index 5aa0ab52..94253ee7 100644 --- a/doc/translation.md +++ b/doc/translation.md @@ -23,7 +23,7 @@ Expanded( ) ``` -Currently, translations are available for these 36 locales: +Currently, translations are available for these 37 locales: * `Locale('en')`, `Locale('ar')`, `Locale('bn')`, `Locale('bs')` * `Locale('cs')`, `Locale('de')`, `Locale('da')`, `Locale('fr')` @@ -32,7 +32,7 @@ Currently, translations are available for these 36 locales: * `Locale('ro', 'RO')`, `Locale('ru')`, `Locale('es')`, `Locale('tk')`, `Locale('tr')` * `Locale('uk')`, `Locale('ur')`, `Locale('pt')`, `Locale('pl')` * `Locale('vi')`, `Locale('id')`, `Locale('it')`, `Locale('ms')` -* `Locale('nl')`, `Locale('no')`, `Locale('fa')`, `Locale('hi')` +* `Locale('nl')`, `Locale('no')`, `Locale('ne', 'NP')`, `Locale('fa')`, `Locale('hi')` * `Locale('sk')`, `Locale('sr')`, `Locale('sv')`, `Locale('sw')`, `Locale('ja')` #### Contributing to translations From 1f9033d26b46a082824ed0217d9fc6fa4c970df4 Mon Sep 17 00:00:00 2001 From: Cheryl Date: Wed, 24 Apr 2024 09:44:31 -0700 Subject: [PATCH 05/10] Upgrade to 9.3.8 --- dart_quill_delta/CHANGELOG.md | 5 +++++ dart_quill_delta/pubspec.yaml | 2 +- flutter_quill_extensions/CHANGELOG.md | 5 +++++ flutter_quill_extensions/pubspec.yaml | 2 +- flutter_quill_test/CHANGELOG.md | 5 +++++ flutter_quill_test/pubspec.yaml | 2 +- pubspec.yaml | 2 +- quill_html_converter/CHANGELOG.md | 5 +++++ quill_html_converter/pubspec.yaml | 2 +- quill_pdf_converter/CHANGELOG.md | 5 +++++ quill_pdf_converter/pubspec.yaml | 2 +- version.dart | 2 +- 12 files changed, 32 insertions(+), 7 deletions(-) diff --git a/dart_quill_delta/CHANGELOG.md b/dart_quill_delta/CHANGELOG.md index 8e284f0c..8ac1caa1 100644 --- a/dart_quill_delta/CHANGELOG.md +++ b/dart_quill_delta/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## 9.3.8 +* fix: removed misleading parameters +* fix: added missed translations for ru, es, de +* added translations for Nepali Locale('ne', 'NP') + ## 9.3.7 * Fix for keyboard jumping when switching focus from a TextField * Toolbar button styling to reflect cursor position when running on desktops with keyboard to move care diff --git a/dart_quill_delta/pubspec.yaml b/dart_quill_delta/pubspec.yaml index 90c1ab71..f603e06c 100644 --- a/dart_quill_delta/pubspec.yaml +++ b/dart_quill_delta/pubspec.yaml @@ -1,6 +1,6 @@ name: dart_quill_delta description: A port of quill-js-delta from typescript to dart -version: 9.3.7 +version: 9.3.8 homepage: https://github.com/singerdmx/flutter-quill/tree/master/dart_quill_delta/ repository: https://github.com/singerdmx/flutter-quill/tree/master/dart_quill_delta/ issue_tracker: https://github.com/singerdmx/flutter-quill/issues/ diff --git a/flutter_quill_extensions/CHANGELOG.md b/flutter_quill_extensions/CHANGELOG.md index 8e284f0c..8ac1caa1 100644 --- a/flutter_quill_extensions/CHANGELOG.md +++ b/flutter_quill_extensions/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## 9.3.8 +* fix: removed misleading parameters +* fix: added missed translations for ru, es, de +* added translations for Nepali Locale('ne', 'NP') + ## 9.3.7 * Fix for keyboard jumping when switching focus from a TextField * Toolbar button styling to reflect cursor position when running on desktops with keyboard to move care diff --git a/flutter_quill_extensions/pubspec.yaml b/flutter_quill_extensions/pubspec.yaml index 84a98509..c408d849 100644 --- a/flutter_quill_extensions/pubspec.yaml +++ b/flutter_quill_extensions/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_quill_extensions description: Embed extensions for flutter_quill including image, video, formula and etc. -version: 9.3.7 +version: 9.3.8 homepage: https://github.com/singerdmx/flutter-quill/tree/master/flutter_quill_extensions/ repository: https://github.com/singerdmx/flutter-quill/tree/master/flutter_quill_extensions/ issue_tracker: https://github.com/singerdmx/flutter-quill/issues/ diff --git a/flutter_quill_test/CHANGELOG.md b/flutter_quill_test/CHANGELOG.md index 8e284f0c..8ac1caa1 100644 --- a/flutter_quill_test/CHANGELOG.md +++ b/flutter_quill_test/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## 9.3.8 +* fix: removed misleading parameters +* fix: added missed translations for ru, es, de +* added translations for Nepali Locale('ne', 'NP') + ## 9.3.7 * Fix for keyboard jumping when switching focus from a TextField * Toolbar button styling to reflect cursor position when running on desktops with keyboard to move care diff --git a/flutter_quill_test/pubspec.yaml b/flutter_quill_test/pubspec.yaml index 51732007..8da25861 100644 --- a/flutter_quill_test/pubspec.yaml +++ b/flutter_quill_test/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_quill_test description: Test utilities for flutter_quill which includes methods to simplify interacting with the editor in test cases. -version: 9.3.7 +version: 9.3.8 homepage: https://github.com/singerdmx/flutter-quill/tree/master/flutter_quill_test/ repository: https://github.com/singerdmx/flutter-quill/tree/master/flutter_quill_test/ issue_tracker: https://github.com/singerdmx/flutter-quill/issues/ diff --git a/pubspec.yaml b/pubspec.yaml index ae4d772c..41926bcf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_quill description: A rich text editor built for the modern Android, iOS, web and desktop platforms. It is the WYSIWYG editor and a Quill component for Flutter. -version: 9.3.7 +version: 9.3.8 homepage: https://1o24bbs.com/c/bulletjournal/108/ repository: https://github.com/singerdmx/flutter-quill/ issue_tracker: https://github.com/singerdmx/flutter-quill/issues/ diff --git a/quill_html_converter/CHANGELOG.md b/quill_html_converter/CHANGELOG.md index 8e284f0c..8ac1caa1 100644 --- a/quill_html_converter/CHANGELOG.md +++ b/quill_html_converter/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## 9.3.8 +* fix: removed misleading parameters +* fix: added missed translations for ru, es, de +* added translations for Nepali Locale('ne', 'NP') + ## 9.3.7 * Fix for keyboard jumping when switching focus from a TextField * Toolbar button styling to reflect cursor position when running on desktops with keyboard to move care diff --git a/quill_html_converter/pubspec.yaml b/quill_html_converter/pubspec.yaml index 79226bf6..04dae1c0 100644 --- a/quill_html_converter/pubspec.yaml +++ b/quill_html_converter/pubspec.yaml @@ -1,6 +1,6 @@ name: quill_html_converter description: A extension for flutter_quill package to add support for dealing with conversion to/from html -version: 9.3.7 +version: 9.3.8 homepage: https://github.com/singerdmx/flutter-quill/tree/master/quill_html_converter/ repository: https://github.com/singerdmx/flutter-quill/tree/master/quill_html_converter/ issue_tracker: https://github.com/singerdmx/flutter-quill/issues/ diff --git a/quill_pdf_converter/CHANGELOG.md b/quill_pdf_converter/CHANGELOG.md index 8e284f0c..8ac1caa1 100644 --- a/quill_pdf_converter/CHANGELOG.md +++ b/quill_pdf_converter/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## 9.3.8 +* fix: removed misleading parameters +* fix: added missed translations for ru, es, de +* added translations for Nepali Locale('ne', 'NP') + ## 9.3.7 * Fix for keyboard jumping when switching focus from a TextField * Toolbar button styling to reflect cursor position when running on desktops with keyboard to move care diff --git a/quill_pdf_converter/pubspec.yaml b/quill_pdf_converter/pubspec.yaml index 25ce11c9..870b0ca3 100644 --- a/quill_pdf_converter/pubspec.yaml +++ b/quill_pdf_converter/pubspec.yaml @@ -1,6 +1,6 @@ name: quill_pdf_converter description: A extension for flutter_quill package to add support for dealing with conversion to pdf -version: 9.3.7 +version: 9.3.8 homepage: https://github.com/singerdmx/flutter-quill/tree/master/quill_pdf_converter/ repository: https://github.com/singerdmx/flutter-quill/tree/master/quill_pdf_converter/ issue_tracker: https://github.com/singerdmx/flutter-quill/issues/ diff --git a/version.dart b/version.dart index 2ffaace0..de66619d 100644 --- a/version.dart +++ b/version.dart @@ -1 +1 @@ -const version = '9.3.7'; +const version = '9.3.8'; From fb2732e9e91a5a60090109930e83124bf25d9c6d Mon Sep 17 00:00:00 2001 From: Cheryl Date: Wed, 24 Apr 2024 09:52:32 -0700 Subject: [PATCH 06/10] Update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e284f0c..8ac1caa1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## 9.3.8 +* fix: removed misleading parameters +* fix: added missed translations for ru, es, de +* added translations for Nepali Locale('ne', 'NP') + ## 9.3.7 * Fix for keyboard jumping when switching focus from a TextField * Toolbar button styling to reflect cursor position when running on desktops with keyboard to move care From 9044e2ad493e822b3bc59a5c1f8f03749eb0f36d Mon Sep 17 00:00:00 2001 From: D Brezack Date: Fri, 26 Apr 2024 16:45:11 -0700 Subject: [PATCH 07/10] fix: MD Parsing for multi space (#1828) * Fixing MD Parsing for multi space * Fixing lint --- lib/src/packages/quill_markdown/markdown_to_delta.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/src/packages/quill_markdown/markdown_to_delta.dart b/lib/src/packages/quill_markdown/markdown_to_delta.dart index 76285a15..53194f77 100644 --- a/lib/src/packages/quill_markdown/markdown_to_delta.dart +++ b/lib/src/packages/quill_markdown/markdown_to_delta.dart @@ -117,9 +117,7 @@ class MarkdownToDelta extends Converter _justPreviousBlockExit = false; _listItemIndent = -1; - final lines = const LineSplitter().convert(input); - final mdNodes = markdownDocument.parseLines(lines); - + final mdNodes = markdownDocument.parseInline(input); _topLevelNodes.addAll(mdNodes); for (final node in mdNodes) { From 08d2a2e4f25577871dd29f38f5e1e011d6ef0661 Mon Sep 17 00:00:00 2001 From: AtlasAutocode <165201146+AtlasAutocode@users.noreply.github.com> Date: Fri, 26 Apr 2024 17:45:50 -0600 Subject: [PATCH 08/10] fix: FontFamily and FontSize toolbars track the text selected in the editor. (#1829) * toggle_style_button : calls to options.afterButtonPressed replaced by call to class function afterButtonPressed to allow default call to base button settings quill_icon_button: L26 build for isSelected updated to call afterButtonPressed = same as if not selected QuillController _updateSelection removed param=source because not used; added new param insertNewline when true set tog to style of preceding char (last entered); updated replaceText to call _updateSelection for NL document collectStyle: Selecting the start of a line, user expects the style to be the visible style of the line including inline styles * color_button calls afterButtonPressed insert at start of line uses style for line * Remove comments * Fix formatting issue * Fix FontFamily and Size button actions * Fix FontFamily and Size button actions * Value setting Stateful toolbar buttons derive from base class * Rename base class as QuillToolbarBaseValueButton * Fixes for before_push script * Removed deprecated functions --------- Co-authored-by: Douglas Ward --- .../lib/screens/quill/my_quill_toolbar.dart | 6 +- lib/src/widgets/quill/quill_controller.dart | 35 ----- .../base_button/base_value_button.dart | 98 ++++++++++++++ .../toolbar/buttons/font_family_button.dart | 121 ++++-------------- .../toolbar/buttons/font_size_button.dart | 92 ++++--------- .../buttons/toggle_check_list_button.dart | 96 +++----------- .../toolbar/buttons/toggle_style_button.dart | 96 +++----------- 7 files changed, 184 insertions(+), 360 deletions(-) create mode 100644 lib/src/widgets/toolbar/base_button/base_value_button.dart diff --git a/example/lib/screens/quill/my_quill_toolbar.dart b/example/lib/screens/quill/my_quill_toolbar.dart index 5acfb2de..7e177956 100644 --- a/example/lib/screens/quill/my_quill_toolbar.dart +++ b/example/lib/screens/quill/my_quill_toolbar.dart @@ -225,7 +225,7 @@ class MyQuillToolbar extends StatelessWidget { // headerStyleType: HeaderStyleType.buttons, // buttonOptions: QuillSimpleToolbarButtonOptions( // base: QuillToolbarBaseButtonOptions( - // afterButtonPressed: focusNode.requestFocus, + // afterButtonPressed: focusNode.requestFocus, // // iconSize: 20, // iconTheme: QuillIconTheme( // iconButtonSelectedData: IconButtonData( @@ -239,8 +239,8 @@ class MyQuillToolbar extends StatelessWidget { // ), // ), // ), - // ), - // ), + // ), + //), customButtons: [ QuillToolbarCustomButtonOptions( icon: const Icon(Icons.add_alarm_rounded), diff --git a/lib/src/widgets/quill/quill_controller.dart b/lib/src/widgets/quill/quill_controller.dart index ebbaa7d6..1a2634e4 100644 --- a/lib/src/widgets/quill/quill_controller.dart +++ b/lib/src/widgets/quill/quill_controller.dart @@ -14,7 +14,6 @@ import '../../models/structs/doc_change.dart'; import '../../models/structs/image_url.dart'; import '../../models/structs/offset_value.dart'; import '../../utils/delta.dart'; -import '../toolbar/buttons/toggle_style_button.dart'; typedef ReplaceTextCallback = bool Function(int index, int len, Object? data); typedef DeleteCallback = void Function(int cursorPosition, bool forward); @@ -67,40 +66,6 @@ class QuillController extends ChangeNotifier { notifyListeners(); } - // Thoses are the values that the user selects and not the one - // from the current line - - /// The current font family, null to use the default one - MapEntry? _selectedFontFamily; - - /// The current font family, null to use the default one - MapEntry? get selectedFontFamily => _selectedFontFamily; - - void selectFontFamily(MapEntry? newFontFamily) { - _selectedFontFamily = newFontFamily; - } - - /// The current font size, null to use the default one - MapEntry? _selectedFontSize; - - /// The current font size, null to use the default one - MapEntry? get selectedFontSize => _selectedFontSize; - - void selectFontSize(MapEntry? newFontSize) { - _selectedFontSize = newFontSize; - } - - /// For the [QuillToolbarToggleStyleButton] - final Map _selectedStyles = {}; - - /// For the [QuillToolbarToggleStyleButton] - Map get selectedStyles => _selectedStyles; - - /// For the [QuillToolbarToggleStyleButton] - void selectStyle(Attribute attribute, bool value) { - _selectedStyles[attribute] = value; - } - /// Tells whether to keep or reset the [toggledStyle] /// when user adds a new line. final bool keepStyleOnNewLine; diff --git a/lib/src/widgets/toolbar/base_button/base_value_button.dart b/lib/src/widgets/toolbar/base_button/base_value_button.dart new file mode 100644 index 00000000..3c2b8046 --- /dev/null +++ b/lib/src/widgets/toolbar/base_button/base_value_button.dart @@ -0,0 +1,98 @@ +import 'package:flutter/material.dart'; + +import '../../../../flutter_quill.dart'; + +/// The [T] is the options for the button +/// The [E] is the extra options for the button +abstract class QuillToolbarBaseValueButton< + T extends QuillToolbarBaseButtonOptions, + E extends QuillToolbarBaseButtonExtraOptions> extends StatefulWidget { + const QuillToolbarBaseValueButton( + {required this.controller, required this.options, super.key}); + + final T options; + + final QuillController controller; +} + +/// The [W] is the widget that creates this State +/// The [V] is the type of the currentValue +abstract class QuillToolbarBaseValueButtonState< + W extends QuillToolbarBaseValueButton, + T extends QuillToolbarBaseButtonOptions, + E extends QuillToolbarBaseButtonExtraOptions, + V> extends State { + T get options => widget.options; + + QuillController get controller => widget.controller; + + late V currentValue; + + /// Callback to query the widget's state for the value to be assigned to currentState + V get currentStateValue; + + @override + void initState() { + super.initState(); + controller.addListener(didChangeEditingValue); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + currentValue = currentStateValue; + } + + void didChangeEditingValue() { + setState(() => currentValue = currentStateValue); + } + + @override + void dispose() { + controller.removeListener(didChangeEditingValue); + super.dispose(); + } + + @override + void didUpdateWidget(covariant W oldWidget) { + super.didUpdateWidget(oldWidget); + if (oldWidget.controller != controller) { + oldWidget.controller.removeListener(didChangeEditingValue); + controller.addListener(didChangeEditingValue); + currentValue = currentStateValue; + } + } + + String get defaultTooltip; + + String get tooltip { + return options.tooltip ?? + context.quillToolbarBaseButtonOptions?.tooltip ?? + defaultTooltip; + } + + double get iconSize { + final baseFontSize = baseButtonExtraOptions?.iconSize; + final iconSize = options.iconSize; + return iconSize ?? baseFontSize ?? kDefaultIconSize; + } + + double get iconButtonFactor { + final baseIconFactor = baseButtonExtraOptions?.iconButtonFactor; + final iconButtonFactor = options.iconButtonFactor; + return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor; + } + + QuillIconTheme? get iconTheme { + return options.iconTheme ?? baseButtonExtraOptions?.iconTheme; + } + + QuillToolbarBaseButtonOptions? get baseButtonExtraOptions { + return context.quillToolbarBaseButtonOptions; + } + + VoidCallback? get afterButtonPressed { + return options.afterButtonPressed ?? + baseButtonExtraOptions?.afterButtonPressed; + } +} diff --git a/lib/src/widgets/toolbar/buttons/font_family_button.dart b/lib/src/widgets/toolbar/buttons/font_family_button.dart index a8ba667b..10cf8712 100644 --- a/lib/src/widgets/toolbar/buttons/font_family_button.dart +++ b/lib/src/widgets/toolbar/buttons/font_family_button.dart @@ -4,55 +4,43 @@ import '../../../../extensions.dart'; import '../../../extensions/quill_configurations_ext.dart'; import '../../../l10n/extensions/localizations.dart'; import '../../../models/documents/attribute.dart'; -import '../../../models/themes/quill_icon_theme.dart'; -import '../../quill/quill_controller.dart'; +import '../base_button/base_value_button.dart'; import '../base_toolbar.dart'; -class QuillToolbarFontFamilyButton extends StatefulWidget { +class QuillToolbarFontFamilyButton extends QuillToolbarBaseValueButton< + QuillToolbarFontFamilyButtonOptions, + QuillToolbarFontFamilyButtonExtraOptions> { QuillToolbarFontFamilyButton({ - required this.controller, + required super.controller, @Deprecated('Please use the default display text from the options') this.defaultDisplayText, - this.options = const QuillToolbarFontFamilyButtonOptions(), + super.options = const QuillToolbarFontFamilyButtonOptions(), super.key, }) : assert(options.rawItemsMap?.isNotEmpty ?? (true)), assert( options.initialValue == null || options.initialValue!.isNotEmpty, ); - final QuillToolbarFontFamilyButtonOptions options; - final String? defaultDisplayText; - /// Since we can't get the state from the instace of the widget for comparing - /// in [didUpdateWidget] then we will have to store reference here - final QuillController controller; - @override QuillToolbarFontFamilyButtonState createState() => QuillToolbarFontFamilyButtonState(); } class QuillToolbarFontFamilyButtonState - extends State { - var _currentValue = ''; - - QuillToolbarFontFamilyButtonOptions get options { - return widget.options; - } - - @override - void initState() { - super.initState(); - _initState(); - } - - void _initState() {} - + extends QuillToolbarBaseValueButtonState< + QuillToolbarFontFamilyButton, + QuillToolbarFontFamilyButtonOptions, + QuillToolbarFontFamilyButtonExtraOptions, + String> { @override - void didChangeDependencies() { - super.didChangeDependencies(); - _currentValue = _defaultDisplayText; + String get currentStateValue { + final attribute = + controller.getSelectionStyle().attributes[options.attribute.key]; + return attribute == null + ? _defaultDisplayText + : (_getKeyName(attribute.value) ?? _defaultDisplayText); } String get _defaultDisplayText { @@ -62,27 +50,6 @@ class QuillToolbarFontFamilyButtonState context.loc.font; } - // @override - // void didUpdateWidget(covariant QuillToolbarFontFamilyButton oldWidget) { - // super.didUpdateWidget(oldWidget); - // if (oldWidget.controller == controller) { - // return; - // } - // controller - // ..removeListener(_didChangeEditingValue) - // ..addListener(_didChangeEditingValue); - // } - - // void _didChangeEditingValue() { - // final attribute = _selectionStyle.attributes[options.attribute.key]; - // if (attribute == null) { - // setState(() => _currentValue = _defaultDisplayText); - // return; - // } - // final keyName = _getKeyName(attribute.value); - // setState(() => _currentValue = keyName ?? _defaultDisplayText); - // } - Map get rawItemsMap { final rawItemsMap = context.quillSimpleToolbarConfigurations?.fontFamilyValues ?? @@ -110,38 +77,8 @@ class QuillToolbarFontFamilyButtonState return null; } - QuillController get controller { - return widget.controller; - } - - double get iconSize { - final baseFontSize = context.quillToolbarBaseButtonOptions?.iconSize; - final iconSize = options.iconSize; - return iconSize ?? baseFontSize ?? kDefaultIconSize; - } - - double get iconButtonFactor { - final baseIconFactor = - context.quillToolbarBaseButtonOptions?.iconButtonFactor; - final iconButtonFactor = widget.options.iconButtonFactor; - return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor; - } - - VoidCallback? get afterButtonPressed { - return options.afterButtonPressed ?? - context.quillToolbarBaseButtonOptions?.afterButtonPressed; - } - - QuillIconTheme? get iconTheme { - return options.iconTheme ?? - context.quillToolbarBaseButtonOptions?.iconTheme; - } - - String get tooltip { - return options.tooltip ?? - context.quillToolbarBaseButtonOptions?.tooltip ?? - context.loc.fontFamily; - } + @override + String get defaultTooltip => context.loc.fontFamily; void _onPressed() { if (_menuController.isOpen) { @@ -149,7 +86,7 @@ class QuillToolbarFontFamilyButtonState } else { _menuController.open(); } - options.afterButtonPressed?.call(); + afterButtonPressed?.call(); } final _menuController = MenuController(); @@ -163,7 +100,7 @@ class QuillToolbarFontFamilyButtonState return childBuilder( options, QuillToolbarFontFamilyButtonExtraOptions( - currentValue: _currentValue, + currentValue: currentValue, defaultDisplayText: _defaultDisplayText, controller: controller, context: context, @@ -177,8 +114,8 @@ class QuillToolbarFontFamilyButtonState var effectiveTooltip = tooltip; if (options.overrideTooltipByFontFamily) { effectiveTooltip = effectiveTooltip.isNotEmpty - ? '$effectiveTooltip: $_currentValue' - : '${context.loc.font}: $_currentValue'; + ? '$effectiveTooltip: $currentValue' + : '${context.loc.font}: $currentValue'; } return Tooltip(message: effectiveTooltip, child: child); }, @@ -196,9 +133,9 @@ class QuillToolbarFontFamilyButtonState final keyName = _getKeyName(newValue); setState(() { if (keyName != 'Clear') { - _currentValue = keyName ?? _defaultDisplayText; + currentValue = keyName ?? _defaultDisplayText; } else { - _currentValue = _defaultDisplayText; + currentValue = _defaultDisplayText; } if (keyName != null) { controller.formatSelection( @@ -210,12 +147,6 @@ class QuillToolbarFontFamilyButtonState options.onSelected?.call(newValue); } }); - - if (fontFamily.value == 'Clear') { - controller.selectFontFamily(null); - return; - } - controller.selectFontFamily(fontFamily); }, child: Text( fontFamily.key.toString(), @@ -262,7 +193,7 @@ class QuillToolbarFontFamilyButtonState enabled: hasFinalWidth, wrapper: (child) => Expanded(child: child), child: Text( - widget.controller.selectedFontFamily?.key ?? _currentValue, + currentValue, maxLines: 1, overflow: options.labelOverflow, style: options.style ?? diff --git a/lib/src/widgets/toolbar/buttons/font_size_button.dart b/lib/src/widgets/toolbar/buttons/font_size_button.dart index 17807c47..71a6bfcc 100644 --- a/lib/src/widgets/toolbar/buttons/font_size_button.dart +++ b/lib/src/widgets/toolbar/buttons/font_size_button.dart @@ -5,43 +5,35 @@ import '../../../../extensions.dart'; import '../../../extensions/quill_configurations_ext.dart'; import '../../../l10n/extensions/localizations.dart'; import '../../../models/documents/attribute.dart'; -import '../../../models/themes/quill_icon_theme.dart'; import '../../../utils/font.dart'; -import '../../quill/quill_controller.dart'; +import '../base_button/base_value_button.dart'; import '../base_toolbar.dart'; -class QuillToolbarFontSizeButton extends StatefulWidget { +class QuillToolbarFontSizeButton extends QuillToolbarBaseValueButton< + QuillToolbarFontSizeButtonOptions, QuillToolbarFontSizeButtonExtraOptions> { QuillToolbarFontSizeButton({ - required this.controller, + required super.controller, @Deprecated('Please use the default display text from the options') this.defaultDisplayText, - this.options = const QuillToolbarFontSizeButtonOptions(), + super.options = const QuillToolbarFontSizeButtonOptions(), super.key, }) : assert(options.rawItemsMap?.isNotEmpty ?? true), assert(options.initialValue == null || (options.initialValue?.isNotEmpty ?? true)); - final QuillToolbarFontSizeButtonOptions options; - final String? defaultDisplayText; - /// Since we can't get the state from the instace of the widget for comparing - /// in [didUpdateWidget] then we will have to store reference here - final QuillController controller; - @override QuillToolbarFontSizeButtonState createState() => QuillToolbarFontSizeButtonState(); } -class QuillToolbarFontSizeButtonState - extends State { +class QuillToolbarFontSizeButtonState extends QuillToolbarBaseValueButtonState< + QuillToolbarFontSizeButton, + QuillToolbarFontSizeButtonOptions, + QuillToolbarFontSizeButtonExtraOptions, + String> { final _menuController = MenuController(); - String _currentValue = ''; - - QuillToolbarFontSizeButtonOptions get options { - return widget.options; - } Map get rawItemsMap { final fontSizes = options.rawItemsMap ?? @@ -73,14 +65,12 @@ class QuillToolbarFontSizeButtonState } @override - void didChangeDependencies() { - super.didChangeDependencies(); - _currentValue = _defaultDisplayText; - } - - @override - void dispose() { - super.dispose(); + String get currentStateValue { + final attribute = + controller.getSelectionStyle().attributes[options.attribute.key]; + return attribute == null + ? _defaultDisplayText + : (_getKeyName(attribute.value) ?? _defaultDisplayText); } String? _getKeyName(dynamic value) { @@ -92,38 +82,8 @@ class QuillToolbarFontSizeButtonState return null; } - QuillController get controller { - return widget.controller; - } - - double get iconSize { - final baseFontSize = context.quillToolbarBaseButtonOptions?.iconSize; - final iconSize = options.iconSize; - return iconSize ?? baseFontSize ?? kDefaultIconSize; - } - - double get iconButtonFactor { - final baseIconFactor = - context.quillToolbarBaseButtonOptions?.iconButtonFactor; - final iconButtonFactor = options.iconButtonFactor; - return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor; - } - - VoidCallback? get afterButtonPressed { - return options.afterButtonPressed ?? - context.quillToolbarBaseButtonOptions?.afterButtonPressed; - } - - QuillIconTheme? get iconTheme { - return options.iconTheme ?? - context.quillToolbarBaseButtonOptions?.iconTheme; - } - - String get tooltip { - return options.tooltip ?? - context.quillToolbarBaseButtonOptions?.tooltip ?? - context.loc.fontSize; - } + @override + String get defaultTooltip => context.loc.fontSize; void _onDropdownButtonPressed() { if (_menuController.isOpen) { @@ -144,7 +104,7 @@ class QuillToolbarFontSizeButtonState options, QuillToolbarFontSizeButtonExtraOptions( controller: controller, - currentValue: _currentValue, + currentValue: currentValue, defaultDisplayText: _defaultDisplayText, context: context, onPressed: _onDropdownButtonPressed, @@ -162,9 +122,9 @@ class QuillToolbarFontSizeButtonState final keyName = _getKeyName(newValue); setState(() { if (keyName != context.loc.clear) { - _currentValue = keyName ?? _defaultDisplayText; + currentValue = keyName ?? _defaultDisplayText; } else { - _currentValue = _defaultDisplayText; + currentValue = _defaultDisplayText; } if (keyName != null) { controller.formatSelection( @@ -176,12 +136,6 @@ class QuillToolbarFontSizeButtonState options.onSelected?.call(newValue); } }); - - if (fontSize.value == '0') { - controller.selectFontSize(null); - return; - } - controller.selectFontSize(fontSize); }, child: Text( fontSize.key.toString(), @@ -224,9 +178,7 @@ class QuillToolbarFontSizeButtonState enabled: hasFinalWidth, wrapper: (child) => Expanded(child: child), child: Text( - getLabel(widget.controller.selectedFontSize?.key) ?? - getLabel(_currentValue) ?? - '', + getLabel(currentValue) ?? '', overflow: options.labelOverflow, style: options.style ?? TextStyle( diff --git a/lib/src/widgets/toolbar/buttons/toggle_check_list_button.dart b/lib/src/widgets/toolbar/buttons/toggle_check_list_button.dart index 83679798..00a46db3 100644 --- a/lib/src/widgets/toolbar/buttons/toggle_check_list_button.dart +++ b/lib/src/widgets/toolbar/buttons/toggle_check_list_button.dart @@ -1,48 +1,36 @@ import 'package:flutter/material.dart'; -import '../../../extensions/quill_configurations_ext.dart'; import '../../../l10n/extensions/localizations.dart'; import '../../../models/documents/attribute.dart'; import '../../../models/documents/style.dart'; -import '../../../models/themes/quill_icon_theme.dart'; import '../../../utils/widgets.dart'; -import '../../quill/quill_controller.dart'; +import '../base_button/base_value_button.dart'; import '../base_toolbar.dart'; -class QuillToolbarToggleCheckListButton extends StatefulWidget { +class QuillToolbarToggleCheckListButton extends QuillToolbarBaseValueButton< + QuillToolbarToggleCheckListButtonOptions, + QuillToolbarToggleCheckListButtonExtraOptions> { const QuillToolbarToggleCheckListButton({ - required this.controller, - this.options = const QuillToolbarToggleCheckListButtonOptions(), + required super.controller, + super.options = const QuillToolbarToggleCheckListButtonOptions(), super.key, }); - final QuillToolbarToggleCheckListButtonOptions options; - - final QuillController controller; - @override QuillToolbarToggleCheckListButtonState createState() => QuillToolbarToggleCheckListButtonState(); } class QuillToolbarToggleCheckListButtonState - extends State { - bool? _isToggled; - + extends QuillToolbarBaseValueButtonState< + QuillToolbarToggleCheckListButton, + QuillToolbarToggleCheckListButtonOptions, + QuillToolbarToggleCheckListButtonExtraOptions, + bool> { Style get _selectionStyle => controller.getSelectionStyle(); - void _didChangeEditingValue() { - setState(() { - _isToggled = _getIsToggled(controller.getSelectionStyle().attributes); - }); - } - @override - void initState() { - super.initState(); - _isToggled = _getIsToggled(_selectionStyle.attributes); - controller.addListener(_didChangeEditingValue); - } + bool get currentStateValue => _getIsToggled(_selectionStyle.attributes); bool _getIsToggled(Map attrs) { var attribute = controller.toolbarButtonToggler[Attribute.list.key]; @@ -62,53 +50,7 @@ class QuillToolbarToggleCheckListButtonState } @override - void didUpdateWidget(covariant QuillToolbarToggleCheckListButton oldWidget) { - super.didUpdateWidget(oldWidget); - if (oldWidget.controller != controller) { - oldWidget.controller.removeListener(_didChangeEditingValue); - controller.addListener(_didChangeEditingValue); - _isToggled = _getIsToggled(_selectionStyle.attributes); - } - } - - @override - void dispose() { - controller.removeListener(_didChangeEditingValue); - super.dispose(); - } - - QuillToolbarToggleCheckListButtonOptions get options { - return widget.options; - } - - QuillController get controller { - return widget.controller; - } - - double get iconSize { - final baseFontSize = baseButtonExtraOptions?.iconSize; - final iconSize = options.iconSize; - return iconSize ?? baseFontSize ?? kDefaultIconSize; - } - - double get iconButtonFactor { - final baseIconFactor = baseButtonExtraOptions?.iconButtonFactor; - final iconButtonFactor = options.iconButtonFactor; - return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor; - } - - VoidCallback? get afterButtonPressed { - return options.afterButtonPressed ?? - baseButtonExtraOptions?.afterButtonPressed; - } - - QuillIconTheme? get iconTheme { - return options.iconTheme ?? baseButtonExtraOptions?.iconTheme; - } - - QuillToolbarBaseButtonOptions? get baseButtonExtraOptions { - return context.quillToolbarBaseButtonOptions; - } + String get defaultTooltip => context.loc.checkedList; IconData get iconData { return options.iconData ?? @@ -116,12 +58,6 @@ class QuillToolbarToggleCheckListButtonState Icons.check_box; } - String get tooltip { - return options.tooltip ?? - baseButtonExtraOptions?.tooltip ?? - context.loc.checkedList; - } - @override Widget build(BuildContext context) { final childBuilder = @@ -136,7 +72,7 @@ class QuillToolbarToggleCheckListButtonState _toggleAttribute(); afterButtonPressed?.call(); }, - isToggled: _isToggled ?? false, + isToggled: currentValue, ), ); } @@ -146,7 +82,7 @@ class QuillToolbarToggleCheckListButtonState context, Attribute.unchecked, iconData, - _isToggled, + currentValue, _toggleAttribute, afterButtonPressed, iconSize, @@ -160,7 +96,7 @@ class QuillToolbarToggleCheckListButtonState controller ..skipRequestKeyboard = !options.isShouldRequestKeyboard ..formatSelection( - _isToggled! + currentValue ? Attribute.clone(Attribute.unchecked, null) : Attribute.unchecked, ); diff --git a/lib/src/widgets/toolbar/buttons/toggle_style_button.dart b/lib/src/widgets/toolbar/buttons/toggle_style_button.dart index 6447bffd..fa065190 100644 --- a/lib/src/widgets/toolbar/buttons/toggle_style_button.dart +++ b/lib/src/widgets/toolbar/buttons/toggle_style_button.dart @@ -6,7 +6,7 @@ import '../../../models/documents/attribute.dart'; import '../../../models/documents/style.dart'; import '../../../models/themes/quill_icon_theme.dart'; import '../../../utils/widgets.dart'; -import '../../quill/quill_controller.dart'; +import '../base_button/base_value_button.dart'; import '../base_toolbar.dart'; typedef ToggleStyleButtonBuilder = Widget Function( @@ -20,68 +20,33 @@ typedef ToggleStyleButtonBuilder = Widget Function( QuillIconTheme? iconTheme, ]); -class QuillToolbarToggleStyleButton extends StatefulWidget { +class QuillToolbarToggleStyleButton extends QuillToolbarBaseValueButton< + QuillToolbarToggleStyleButtonOptions, + QuillToolbarToggleStyleButtonExtraOptions> { const QuillToolbarToggleStyleButton({ - required this.controller, + required super.controller, required this.attribute, - this.options = const QuillToolbarToggleStyleButtonOptions(), + super.options = const QuillToolbarToggleStyleButtonOptions(), super.key, }); final Attribute attribute; - final QuillToolbarToggleStyleButtonOptions options; - - final QuillController controller; - @override QuillToolbarToggleStyleButtonState createState() => QuillToolbarToggleStyleButtonState(); } class QuillToolbarToggleStyleButtonState - extends State { - bool? _isToggled; - + extends QuillToolbarBaseValueButtonState< + QuillToolbarToggleStyleButton, + QuillToolbarToggleStyleButtonOptions, + QuillToolbarToggleStyleButtonExtraOptions, + bool> { Style get _selectionStyle => controller.getSelectionStyle(); - QuillToolbarToggleStyleButtonOptions get options { - return widget.options; - } - @override - void initState() { - super.initState(); - _isToggled = _getIsToggled(_selectionStyle.attributes); - controller.addListener(_didChangeEditingValue); - } - - QuillController get controller { - return widget.controller; - } - - double get iconSize { - final baseFontSize = context.quillToolbarBaseButtonOptions?.iconSize; - final iconSize = options.iconSize; - return iconSize ?? baseFontSize ?? kDefaultIconSize; - } - - double get iconButtonFactor { - final baseIconFactor = - context.quillToolbarBaseButtonOptions?.iconButtonFactor; - final iconButtonFactor = options.iconButtonFactor; - return iconButtonFactor ?? baseIconFactor ?? kDefaultIconButtonFactor; - } - - VoidCallback? get afterButtonPressed { - return options.afterButtonPressed ?? - context.quillToolbarBaseButtonOptions?.afterButtonPressed; - } - - QuillIconTheme? get iconTheme { - return options.iconTheme ?? - context.quillToolbarBaseButtonOptions?.iconTheme; - } + bool get currentStateValue => _getIsToggled(_selectionStyle.attributes); (String, IconData) get _defaultTooltipAndIconData { switch (widget.attribute.key) { @@ -133,11 +98,8 @@ class QuillToolbarToggleStyleButtonState } } - String? get tooltip { - return options.tooltip ?? - context.quillToolbarBaseButtonOptions?.tooltip ?? - _defaultTooltipAndIconData.$1; - } + @override + String get defaultTooltip => _defaultTooltipAndIconData.$1; IconData get iconData { return options.iconData ?? @@ -161,7 +123,7 @@ class QuillToolbarToggleStyleButtonState context: context, controller: controller, onPressed: _onPressed, - isToggled: _isToggled ?? false, + isToggled: currentValue, ), ); } @@ -171,7 +133,7 @@ class QuillToolbarToggleStyleButtonState context, widget.attribute, iconData, - _isToggled, + currentValue, _toggleAttribute, afterButtonPressed, iconSize, @@ -181,26 +143,6 @@ class QuillToolbarToggleStyleButtonState ); } - @override - void didUpdateWidget(covariant QuillToolbarToggleStyleButton oldWidget) { - super.didUpdateWidget(oldWidget); - if (oldWidget.controller != controller) { - oldWidget.controller.removeListener(_didChangeEditingValue); - controller.addListener(_didChangeEditingValue); - _isToggled = _getIsToggled(_selectionStyle.attributes); - } - } - - @override - void dispose() { - controller.removeListener(_didChangeEditingValue); - super.dispose(); - } - - void _didChangeEditingValue() { - setState(() => _isToggled = _getIsToggled(_selectionStyle.attributes)); - } - bool _getIsToggled(Map attrs) { if (widget.attribute.key == Attribute.list.key || widget.attribute.key == Attribute.script.key || @@ -216,12 +158,12 @@ class QuillToolbarToggleStyleButtonState void _toggleAttribute() { controller + ..skipRequestKeyboard = !widget.attribute.isInline ..formatSelection( - (_isToggled ?? false) + currentValue ? Attribute.clone(widget.attribute, null) : widget.attribute, - ) - ..selectStyle(widget.attribute, _isToggled ?? false); + ); } } From 75d3b806fccc8d8f6c72d01e4ffd2c7974b48dd9 Mon Sep 17 00:00:00 2001 From: gklamm Date: Sat, 27 Apr 2024 01:46:01 +0200 Subject: [PATCH 09/10] Add checkBoxReadOnly property (#1836) --- .../models/config/editor/editor_configurations.dart | 12 ++++++++++++ .../config/raw_editor/raw_editor_configurations.dart | 10 ++++++++++ lib/src/widgets/editor/editor.dart | 1 + lib/src/widgets/quill/text_block.dart | 4 +++- lib/src/widgets/raw_editor/raw_editor_state.dart | 4 +++- 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/lib/src/models/config/editor/editor_configurations.dart b/lib/src/models/config/editor/editor_configurations.dart index cb64336a..d3f72b0c 100644 --- a/lib/src/models/config/editor/editor_configurations.dart +++ b/lib/src/models/config/editor/editor_configurations.dart @@ -33,6 +33,7 @@ class QuillEditorConfigurations extends Equatable { this.expands = false, this.placeholder, this.readOnly = false, + this.checkBoxReadOnly, this.disableClipboard = false, this.textSelectionThemeData, this.showCursor, @@ -97,6 +98,15 @@ class QuillEditorConfigurations extends Equatable { /// Defaults to `false`. Must not be `null`. final bool readOnly; + /// Override [readOnly] for checkbox. + /// + /// When this is set to `false`, the checkbox can be checked + /// or unchecked while [readOnly] is set to `true`. + /// When this is set to `null`, the [readOnly] value is used. + /// + /// Defaults to `null`. + final bool? checkBoxReadOnly; + /// Disable Clipboard features /// /// when this is set to `true` clipboard can not be used @@ -369,6 +379,7 @@ class QuillEditorConfigurations extends Equatable { QuillController? controller, String? placeholder, bool? readOnly, + bool? checkBoxReadOnly, bool? disableClipboard, bool? scrollable, double? scrollBottomInset, @@ -421,6 +432,7 @@ class QuillEditorConfigurations extends Equatable { controller: controller ?? this.controller, placeholder: placeholder ?? this.placeholder, readOnly: readOnly ?? this.readOnly, + checkBoxReadOnly: checkBoxReadOnly ?? this.checkBoxReadOnly, disableClipboard: disableClipboard ?? this.disableClipboard, scrollable: scrollable ?? this.scrollable, scrollBottomInset: scrollBottomInset ?? this.scrollBottomInset, diff --git a/lib/src/models/config/raw_editor/raw_editor_configurations.dart b/lib/src/models/config/raw_editor/raw_editor_configurations.dart index 726dda0f..eb1f9def 100644 --- a/lib/src/models/config/raw_editor/raw_editor_configurations.dart +++ b/lib/src/models/config/raw_editor/raw_editor_configurations.dart @@ -50,6 +50,7 @@ class QuillRawEditorConfigurations extends Equatable { this.scrollable = true, this.padding = EdgeInsets.zero, this.readOnly = false, + this.checkBoxReadOnly, this.disableClipboard = false, this.placeholder, this.onLaunchUrl, @@ -104,6 +105,15 @@ class QuillRawEditorConfigurations extends Equatable { /// Defaults to false. Must not be null. final bool readOnly; + /// Override readOnly for checkbox. + /// + /// When this is set to false, the checkbox can be checked + /// or unchecked while readOnly is set to true. + /// When this is set to null, the readOnly value is used. + /// + /// Defaults to null. + final bool? checkBoxReadOnly; + /// Disable Clipboard features /// /// when this is set to true clipboard can not be used diff --git a/lib/src/widgets/editor/editor.dart b/lib/src/widgets/editor/editor.dart index 4c4ea7cb..a68d15ce 100644 --- a/lib/src/widgets/editor/editor.dart +++ b/lib/src/widgets/editor/editor.dart @@ -235,6 +235,7 @@ class QuillEditorState extends State scrollBottomInset: configurations.scrollBottomInset, padding: configurations.padding, readOnly: configurations.readOnly, + checkBoxReadOnly: configurations.checkBoxReadOnly, disableClipboard: configurations.disableClipboard, placeholder: configurations.placeholder, onLaunchUrl: configurations.onLaunchUrl, diff --git a/lib/src/widgets/quill/text_block.dart b/lib/src/widgets/quill/text_block.dart index 8fb89191..c0b6b187 100644 --- a/lib/src/widgets/quill/text_block.dart +++ b/lib/src/widgets/quill/text_block.dart @@ -74,6 +74,7 @@ class EditableTextBlock extends StatelessWidget { required this.clearIndents, required this.onCheckboxTap, required this.readOnly, + this.checkBoxReadOnly, this.onLaunchUrl, this.customStyleBuilder, this.customLinkPrefixes = const [], @@ -100,6 +101,7 @@ class EditableTextBlock extends StatelessWidget { final bool clearIndents; final Function(int, bool) onCheckboxTap; final bool readOnly; + final bool? checkBoxReadOnly; final List customLinkPrefixes; @override @@ -279,7 +281,7 @@ class EditableTextBlock extends StatelessWidget { return QuillEditorCheckboxPoint( size: fontSize, value: attrs[Attribute.list.key] == Attribute.checked, - enabled: !readOnly, + enabled: !(checkBoxReadOnly ?? readOnly), onChanged: (checked) => onCheckboxTap(line.documentOffset, checked), uiBuilder: defaultStyles.lists?.checkboxUIBuilder, ); diff --git a/lib/src/widgets/raw_editor/raw_editor_state.dart b/lib/src/widgets/raw_editor/raw_editor_state.dart index da636414..957e6186 100644 --- a/lib/src/widgets/raw_editor/raw_editor_state.dart +++ b/lib/src/widgets/raw_editor/raw_editor_state.dart @@ -998,7 +998,8 @@ class QuillRawEditorState extends EditorState void _handleCheckboxTap(int offset, bool value) { final requestKeyboardFocusOnCheckListChanged = widget.configurations.requestKeyboardFocusOnCheckListChanged; - if (!widget.configurations.readOnly) { + if (!(widget.configurations.checkBoxReadOnly ?? + widget.configurations.readOnly)) { _disableScrollControllerAnimateOnce = true; final currentSelection = controller.selection.copyWith(); final attribute = value ? Attribute.checked : Attribute.unchecked; @@ -1074,6 +1075,7 @@ class QuillRawEditorState extends EditorState clearIndents: clearIndents, onCheckboxTap: _handleCheckboxTap, readOnly: widget.configurations.readOnly, + checkBoxReadOnly: widget.configurations.checkBoxReadOnly, customStyleBuilder: widget.configurations.customStyleBuilder, customLinkPrefixes: widget.configurations.customLinkPrefixes, ); From b7711bb46d6ad3e4f0d6942335a753b6818e28c0 Mon Sep 17 00:00:00 2001 From: Cheryl Date: Fri, 26 Apr 2024 16:56:57 -0700 Subject: [PATCH 10/10] Upgrade to 9.3.9 --- CHANGELOG.md | 5 +++++ dart_quill_delta/CHANGELOG.md | 5 +++++ dart_quill_delta/pubspec.yaml | 2 +- flutter_quill_extensions/CHANGELOG.md | 5 +++++ flutter_quill_extensions/pubspec.yaml | 2 +- flutter_quill_test/pubspec.yaml | 2 +- pubspec.yaml | 2 +- quill_html_converter/CHANGELOG.md | 5 +++++ quill_html_converter/pubspec.yaml | 2 +- quill_pdf_converter/CHANGELOG.md | 5 +++++ quill_pdf_converter/pubspec.yaml | 2 +- version.dart | 2 +- 12 files changed, 32 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ac1caa1..24ed8a4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## 9.3.9 +* fix: MD Parsing for multi space +* fix: FontFamily and FontSize toolbars track the text selected in the editor +* feat: Add checkBoxReadOnly property which can override readOnly for checkbox + ## 9.3.8 * fix: removed misleading parameters * fix: added missed translations for ru, es, de diff --git a/dart_quill_delta/CHANGELOG.md b/dart_quill_delta/CHANGELOG.md index 8ac1caa1..24ed8a4e 100644 --- a/dart_quill_delta/CHANGELOG.md +++ b/dart_quill_delta/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## 9.3.9 +* fix: MD Parsing for multi space +* fix: FontFamily and FontSize toolbars track the text selected in the editor +* feat: Add checkBoxReadOnly property which can override readOnly for checkbox + ## 9.3.8 * fix: removed misleading parameters * fix: added missed translations for ru, es, de diff --git a/dart_quill_delta/pubspec.yaml b/dart_quill_delta/pubspec.yaml index f603e06c..62441a0f 100644 --- a/dart_quill_delta/pubspec.yaml +++ b/dart_quill_delta/pubspec.yaml @@ -1,6 +1,6 @@ name: dart_quill_delta description: A port of quill-js-delta from typescript to dart -version: 9.3.8 +version: 9.3.9 homepage: https://github.com/singerdmx/flutter-quill/tree/master/dart_quill_delta/ repository: https://github.com/singerdmx/flutter-quill/tree/master/dart_quill_delta/ issue_tracker: https://github.com/singerdmx/flutter-quill/issues/ diff --git a/flutter_quill_extensions/CHANGELOG.md b/flutter_quill_extensions/CHANGELOG.md index 8ac1caa1..24ed8a4e 100644 --- a/flutter_quill_extensions/CHANGELOG.md +++ b/flutter_quill_extensions/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## 9.3.9 +* fix: MD Parsing for multi space +* fix: FontFamily and FontSize toolbars track the text selected in the editor +* feat: Add checkBoxReadOnly property which can override readOnly for checkbox + ## 9.3.8 * fix: removed misleading parameters * fix: added missed translations for ru, es, de diff --git a/flutter_quill_extensions/pubspec.yaml b/flutter_quill_extensions/pubspec.yaml index c408d849..f251c6a4 100644 --- a/flutter_quill_extensions/pubspec.yaml +++ b/flutter_quill_extensions/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_quill_extensions description: Embed extensions for flutter_quill including image, video, formula and etc. -version: 9.3.8 +version: 9.3.9 homepage: https://github.com/singerdmx/flutter-quill/tree/master/flutter_quill_extensions/ repository: https://github.com/singerdmx/flutter-quill/tree/master/flutter_quill_extensions/ issue_tracker: https://github.com/singerdmx/flutter-quill/issues/ diff --git a/flutter_quill_test/pubspec.yaml b/flutter_quill_test/pubspec.yaml index 8da25861..c51881e5 100644 --- a/flutter_quill_test/pubspec.yaml +++ b/flutter_quill_test/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_quill_test description: Test utilities for flutter_quill which includes methods to simplify interacting with the editor in test cases. -version: 9.3.8 +version: 9.3.9 homepage: https://github.com/singerdmx/flutter-quill/tree/master/flutter_quill_test/ repository: https://github.com/singerdmx/flutter-quill/tree/master/flutter_quill_test/ issue_tracker: https://github.com/singerdmx/flutter-quill/issues/ diff --git a/pubspec.yaml b/pubspec.yaml index 41926bcf..5ec1de08 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_quill description: A rich text editor built for the modern Android, iOS, web and desktop platforms. It is the WYSIWYG editor and a Quill component for Flutter. -version: 9.3.8 +version: 9.3.9 homepage: https://1o24bbs.com/c/bulletjournal/108/ repository: https://github.com/singerdmx/flutter-quill/ issue_tracker: https://github.com/singerdmx/flutter-quill/issues/ diff --git a/quill_html_converter/CHANGELOG.md b/quill_html_converter/CHANGELOG.md index 8ac1caa1..24ed8a4e 100644 --- a/quill_html_converter/CHANGELOG.md +++ b/quill_html_converter/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## 9.3.9 +* fix: MD Parsing for multi space +* fix: FontFamily and FontSize toolbars track the text selected in the editor +* feat: Add checkBoxReadOnly property which can override readOnly for checkbox + ## 9.3.8 * fix: removed misleading parameters * fix: added missed translations for ru, es, de diff --git a/quill_html_converter/pubspec.yaml b/quill_html_converter/pubspec.yaml index 04dae1c0..e6e766d0 100644 --- a/quill_html_converter/pubspec.yaml +++ b/quill_html_converter/pubspec.yaml @@ -1,6 +1,6 @@ name: quill_html_converter description: A extension for flutter_quill package to add support for dealing with conversion to/from html -version: 9.3.8 +version: 9.3.9 homepage: https://github.com/singerdmx/flutter-quill/tree/master/quill_html_converter/ repository: https://github.com/singerdmx/flutter-quill/tree/master/quill_html_converter/ issue_tracker: https://github.com/singerdmx/flutter-quill/issues/ diff --git a/quill_pdf_converter/CHANGELOG.md b/quill_pdf_converter/CHANGELOG.md index 8ac1caa1..24ed8a4e 100644 --- a/quill_pdf_converter/CHANGELOG.md +++ b/quill_pdf_converter/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## 9.3.9 +* fix: MD Parsing for multi space +* fix: FontFamily and FontSize toolbars track the text selected in the editor +* feat: Add checkBoxReadOnly property which can override readOnly for checkbox + ## 9.3.8 * fix: removed misleading parameters * fix: added missed translations for ru, es, de diff --git a/quill_pdf_converter/pubspec.yaml b/quill_pdf_converter/pubspec.yaml index 870b0ca3..611191f6 100644 --- a/quill_pdf_converter/pubspec.yaml +++ b/quill_pdf_converter/pubspec.yaml @@ -1,6 +1,6 @@ name: quill_pdf_converter description: A extension for flutter_quill package to add support for dealing with conversion to pdf -version: 9.3.8 +version: 9.3.9 homepage: https://github.com/singerdmx/flutter-quill/tree/master/quill_pdf_converter/ repository: https://github.com/singerdmx/flutter-quill/tree/master/quill_pdf_converter/ issue_tracker: https://github.com/singerdmx/flutter-quill/issues/ diff --git a/version.dart b/version.dart index de66619d..c8a06db8 100644 --- a/version.dart +++ b/version.dart @@ -1 +1 @@ -const version = '9.3.8'; +const version = '9.3.9';