Carry all the changes from @MacDeveloper1 PR

pull/1597/head
Ellet 1 year ago
parent 47031e1250
commit b03e6f4f29
No known key found for this signature in database
GPG Key ID: C488CC70BBCEF0D1
  1. 6
      CHANGELOG.md
  2. 8
      example/lib/presentation/quill/my_quill_toolbar.dart
  3. 2
      lib/flutter_quill.dart
  4. 18
      lib/src/l10n/generated/quill_localizations.dart
  5. 9
      lib/src/l10n/generated/quill_localizations_ar.dart
  6. 9
      lib/src/l10n/generated/quill_localizations_bg.dart
  7. 9
      lib/src/l10n/generated/quill_localizations_bn.dart
  8. 9
      lib/src/l10n/generated/quill_localizations_cs.dart
  9. 9
      lib/src/l10n/generated/quill_localizations_da.dart
  10. 9
      lib/src/l10n/generated/quill_localizations_de.dart
  11. 9
      lib/src/l10n/generated/quill_localizations_en.dart
  12. 9
      lib/src/l10n/generated/quill_localizations_es.dart
  13. 9
      lib/src/l10n/generated/quill_localizations_fa.dart
  14. 9
      lib/src/l10n/generated/quill_localizations_fr.dart
  15. 9
      lib/src/l10n/generated/quill_localizations_he.dart
  16. 9
      lib/src/l10n/generated/quill_localizations_hi.dart
  17. 9
      lib/src/l10n/generated/quill_localizations_id.dart
  18. 9
      lib/src/l10n/generated/quill_localizations_it.dart
  19. 9
      lib/src/l10n/generated/quill_localizations_ja.dart
  20. 9
      lib/src/l10n/generated/quill_localizations_ko.dart
  21. 9
      lib/src/l10n/generated/quill_localizations_ms.dart
  22. 9
      lib/src/l10n/generated/quill_localizations_nl.dart
  23. 9
      lib/src/l10n/generated/quill_localizations_no.dart
  24. 9
      lib/src/l10n/generated/quill_localizations_pl.dart
  25. 9
      lib/src/l10n/generated/quill_localizations_pt.dart
  26. 21
      lib/src/l10n/generated/quill_localizations_ru.dart
  27. 9
      lib/src/l10n/generated/quill_localizations_sr.dart
  28. 9
      lib/src/l10n/generated/quill_localizations_sw.dart
  29. 9
      lib/src/l10n/generated/quill_localizations_tk.dart
  30. 9
      lib/src/l10n/generated/quill_localizations_tr.dart
  31. 32
      lib/src/l10n/generated/quill_localizations_uk.dart
  32. 9
      lib/src/l10n/generated/quill_localizations_ur.dart
  33. 9
      lib/src/l10n/generated/quill_localizations_vi.dart
  34. 9
      lib/src/l10n/generated/quill_localizations_zh.dart
  35. 114
      lib/src/l10n/untranslated.json
  36. 32
      lib/src/models/config/toolbar/buttons/select_header_style_button_configurations.dart
  37. 3
      lib/src/models/config/toolbar/buttons/select_header_style_buttons_configurations.dart
  38. 121
      lib/src/models/config/toolbar/buttons/select_header_style_dropdown_button_configurations.dart
  39. 136
      lib/src/models/config/toolbar/simple_toolbar_button_options.dart
  40. 138
      lib/src/models/config/toolbar/simple_toolbar_configurations.dart
  41. 4
      lib/src/models/config/toolbar/toolbar_configurations.dart
  42. 4
      lib/src/models/config/toolbar/toolbar_shared_configurations.dart
  43. 12
      lib/src/models/documents/attribute.dart
  44. 118
      lib/src/widgets/others/default_styles.dart
  45. 12
      lib/src/widgets/quill/text_block.dart
  46. 3
      lib/src/widgets/quill/text_line.dart
  47. 21
      lib/src/widgets/raw_editor/raw_editor_state.dart
  48. 2
      lib/src/widgets/toolbar/base_toolbar.dart
  49. 120
      lib/src/widgets/toolbar/buttons/hearder_style/select_header_style_dropdown_button.dart
  50. 6
      lib/src/widgets/toolbar/simple_toolbar.dart

@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file.
## 9.0.2-dev.2
* Add the new translations for ru, uk arb files by [#1575](https://github.com/singerdmx/flutter-quill/pull/1575)
* Add a new dropdown button by [#1575](https://github.com/singerdmx/flutter-quill/pull/1575)
* Update the default style values by [#1575](https://github.com/singerdmx/flutter-quill/pull/1575)
## 9.0.2-dev.1
* Add configurations for the new dropdown `QuillToolbarSelectHeaderStyleButton`, you can use the orignal one or this
* Fix the [issue](https://github.com/singerdmx/flutter-quill/issues/1119) when enter is pressed, all font settings is lost

@ -159,7 +159,7 @@ class MyQuillToolbar extends StatelessWidget {
isBackground: true,
),
const VerticalDivider(),
QuillToolbarSelectHeaderStyleButton(
QuillToolbarSelectHeaderStyleDropdownButton(
controller: controller,
),
const VerticalDivider(),
@ -201,14 +201,14 @@ class MyQuillToolbar extends StatelessWidget {
configurations: QuillSimpleToolbarConfigurations(
controller: controller,
showAlignmentButtons: true,
buttonOptions: QuillToolbarButtonOptions(
buttonOptions: QuillSimpleToolbarButtonOptions(
base: QuillToolbarBaseButtonOptions(
// Request editor focus when any button is pressed
afterButtonPressed: focusNode.requestFocus,
globalIconSize: 18,
),
selectHeaderStyleButton:
const QuillToolbarSelectHeaderStyleButtonOptions(
selectHeaderStyleDropdownButton:
const QuillToolbarSelectHeaderStyleDropdownButtonOptions(
textStyle: TextStyle(
fontSize: 20,
),

@ -32,6 +32,6 @@ export 'src/widgets/raw_editor/raw_editor.dart';
export 'src/widgets/raw_editor/raw_editor_state.dart';
export 'src/widgets/style_widgets/style_widgets.dart';
export 'src/widgets/toolbar/base_toolbar.dart';
export 'src/widgets/toolbar/buttons/hearder_style/select_header_style_button.dart';
export 'src/widgets/toolbar/buttons/hearder_style/select_header_style_dropdown_button.dart';
export 'src/widgets/toolbar/simple_toolbar.dart';
export 'src/widgets/utils/provider.dart';

@ -445,6 +445,24 @@ abstract class FlutterQuillLocalizations {
/// **'Heading 3'**
String get heading3;
/// No description provided for @heading4.
///
/// In en, this message translates to:
/// **'Heading 4'**
String get heading4;
/// No description provided for @heading5.
///
/// In en, this message translates to:
/// **'Heading 5'**
String get heading5;
/// No description provided for @heading6.
///
/// In en, this message translates to:
/// **'Heading 6'**
String get heading6;
/// No description provided for @numberedList.
///
/// In en, this message translates to:

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsAr extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'قائمة مرقمة';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsBg extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Номериран списък';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsBn extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'ত তি';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsCs extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Číslovaný seznam';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsDa extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Numbered list';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsDe extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Nummerierte Liste';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsEn extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Numbered list';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsEs extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Numbered list';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsFa extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'لیست شمارهدار';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsFr extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Liste numérotée';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsHe extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'רשימה ממוספרת';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsHi extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'बदध स';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsId extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Daftar Bernomor';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsIt extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Elenco numerato';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsJa extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => '順序付きリスト';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsKo extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Numbered list';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsMs extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Numbered list';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsNl extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Numbered list';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsNo extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Nummerert liste';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsPl extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Numbered list';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsPt extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Numbered list';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsRu extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Numbered list';
@ -241,19 +250,21 @@ class FlutterQuillLocalizationsRu extends FlutterQuillLocalizations {
String get insertImage => 'Вставить изображение';
@override
String get pickAPhotoFromYourGallery => 'Pick a photo from your gallery';
String get pickAPhotoFromYourGallery => 'Выберите фотографю из вашей галереи';
@override
String get takeAPhotoUsingYourCamera => 'Take a photo using your camera';
String get takeAPhotoUsingYourCamera =>
'Создайте фотографю, использую фотокамеру';
@override
String get pasteAPhotoUsingALink => 'Paste a photo using a link';
String get pasteAPhotoUsingALink => 'Вставьте фотографию, используя ссылку';
@override
String get pickAVideoFromYourGallery => 'Pick a video from your gallery';
String get pickAVideoFromYourGallery => 'Выберете видео из вашей галереи';
@override
String get recordAVideoUsingYourCamera => 'Record a video using your camera';
String get recordAVideoUsingYourCamera =>
'Запишите видео, используя вдеокамеру';
@override
String get pasteAVideoUsingALink => 'Paste a video using a link';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsSr extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Numerisana lista';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsSw extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Orodha ya Nambari';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsTk extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Sanly sanaw';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsTr extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Numaralı Liste';

@ -137,16 +137,25 @@ class FlutterQuillLocalizationsUk extends FlutterQuillLocalizations {
String get headerStyle => 'Стиль заголовка';
@override
String get normal => 'Normal';
String get normal => 'Звичайний';
@override
String get heading1 => 'Heading 1';
String get heading1 => 'Заголовок 1';
@override
String get heading2 => 'Heading 2';
String get heading2 => 'Заголовок 2';
@override
String get heading3 => 'Heading 3';
String get heading3 => 'Заголовок 3';
@override
String get heading4 => 'Заголовок 4';
@override
String get heading5 => 'Заголовок 5';
@override
String get heading6 => 'Заголовок 6';
@override
String get numberedList => 'Нумерований список';
@ -243,20 +252,23 @@ class FlutterQuillLocalizationsUk extends FlutterQuillLocalizations {
String get insertImage => 'Вставити зображення';
@override
String get pickAPhotoFromYourGallery => 'Pick a photo from your gallery';
String get pickAPhotoFromYourGallery => 'Оберіть фотографію з вашої галереї';
@override
String get takeAPhotoUsingYourCamera => 'Take a photo using your camera';
String get takeAPhotoUsingYourCamera =>
'Створіть фотографію, використовуючи фотокамеру';
@override
String get pasteAPhotoUsingALink => 'Paste a photo using a link';
String get pasteAPhotoUsingALink =>
'Вставте фотографію, використовуючи посилання';
@override
String get pickAVideoFromYourGallery => 'Pick a video from your gallery';
String get pickAVideoFromYourGallery => 'Оберіть відео з вашої галереї';
@override
String get recordAVideoUsingYourCamera => 'Record a video using your camera';
String get recordAVideoUsingYourCamera =>
'Запишіть відео, використовуючи відеокамеру';
@override
String get pasteAVideoUsingALink => 'Paste a video using a link';
String get pasteAVideoUsingALink => 'Вставте відео, використовуючи посилання';
}

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsUr extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'مرقم فہرست';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsVi extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => 'Danh sách có số';

@ -148,6 +148,15 @@ class FlutterQuillLocalizationsZh extends FlutterQuillLocalizations {
@override
String get heading3 => 'Heading 3';
@override
String get heading4 => 'Heading 4';
@override
String get heading5 => 'Heading 5';
@override
String get heading6 => 'Heading 6';
@override
String get numberedList => '编号列表';

@ -4,6 +4,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -17,6 +20,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -30,6 +36,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -43,6 +52,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -56,6 +68,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -69,6 +84,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -82,6 +100,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -95,6 +116,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -108,6 +132,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -121,6 +148,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -134,6 +164,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -147,6 +180,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -160,6 +196,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -173,6 +212,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -186,6 +228,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -199,6 +244,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -212,6 +260,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -225,6 +276,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -238,6 +292,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -251,6 +308,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -264,6 +324,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -277,6 +340,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -290,11 +356,9 @@
"heading1",
"heading2",
"heading3",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
"pickAVideoFromYourGallery",
"recordAVideoUsingYourCamera",
"heading4",
"heading5",
"heading6",
"pasteAVideoUsingALink"
],
@ -303,6 +367,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -316,6 +383,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -329,6 +399,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -342,19 +415,9 @@
"heading1",
"heading2",
"heading3",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
"pickAVideoFromYourGallery",
"recordAVideoUsingYourCamera",
"pasteAVideoUsingALink"
],
"uk": [
"normal",
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -368,6 +431,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -381,6 +447,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -394,6 +463,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -407,6 +479,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",
@ -420,6 +495,9 @@
"heading1",
"heading2",
"heading3",
"heading4",
"heading5",
"heading6",
"pickAPhotoFromYourGallery",
"takeAPhotoUsingYourCamera",
"pasteAPhotoUsingALink",

@ -1,32 +0,0 @@
import 'package:flutter/widgets.dart' show TextStyle;
import '../../../../widgets/toolbar/base_toolbar.dart';
class QuillToolbarSelectHeaderStyleButtonExtraOptions
extends QuillToolbarBaseButtonExtraOptions {
const QuillToolbarSelectHeaderStyleButtonExtraOptions({
required super.controller,
required super.context,
required super.onPressed,
});
}
class QuillToolbarSelectHeaderStyleButtonOptions
extends QuillToolbarBaseButtonOptions<
QuillToolbarSelectHeaderStyleButtonOptions,
QuillToolbarSelectHeaderStyleButtonExtraOptions> {
const QuillToolbarSelectHeaderStyleButtonOptions({
super.afterButtonPressed,
super.childBuilder,
super.iconTheme,
super.tooltip,
this.iconSize,
this.iconButtonFactor,
this.textStyle,
});
/// By default we will the toolbar axis from [QuillSimpleToolbarConfigurations]
final double? iconSize;
final double? iconButtonFactor;
final TextStyle? textStyle;
}

@ -28,12 +28,15 @@ class QuillToolbarSelectHeaderStyleButtonsOptions
});
/// Default value:
///
/// ```dart
/// const [
/// Attribute.header,
/// Attribute.h1,
/// Attribute.h2,
/// Attribute.h3,
/// ]
/// ```
final List<Attribute>? attributes;
/// By default we will the toolbar axis from [QuillSimpleToolbarConfigurations]

@ -0,0 +1,121 @@
import 'package:flutter/material.dart' show PopupMenuEntry;
import 'package:flutter/widgets.dart'
show
Color,
EdgeInsets,
EdgeInsetsGeometry,
IconData,
TextOverflow,
TextStyle,
ValueChanged,
VoidCallback;
import '../../../../widgets/toolbar/base_toolbar.dart';
import '../../../documents/attribute.dart';
import '../../../themes/quill_icon_theme.dart';
class QuillToolbarSelectHeaderStyleDropdownButtonExtraOptions
extends QuillToolbarBaseButtonExtraOptions {
const QuillToolbarSelectHeaderStyleDropdownButtonExtraOptions({
required super.controller,
required super.context,
required super.onPressed,
required this.currentValue,
});
final Attribute currentValue;
}
class QuillToolbarSelectHeaderStyleDropdownButtonOptions
extends QuillToolbarBaseButtonOptions<
QuillToolbarSelectHeaderStyleDropdownButtonOptions,
QuillToolbarSelectHeaderStyleDropdownButtonExtraOptions> {
const QuillToolbarSelectHeaderStyleDropdownButtonOptions({
super.afterButtonPressed,
super.childBuilder,
super.iconTheme,
super.tooltip,
this.iconSize,
this.iconButtonFactor,
this.textStyle,
super.iconData,
this.fillColor,
this.hoverElevation = 1,
this.highlightElevation = 1,
this.onSelected,
this.attributes,
this.padding,
this.style,
this.width,
this.labelOverflow = TextOverflow.visible,
this.itemHeight,
this.itemPadding,
this.defaultItemColor,
this.renderItemTextStyle = false,
});
/// By default we will the toolbar axis from [QuillSimpleToolbarConfigurations]
final double? iconSize;
final double? iconButtonFactor;
final TextStyle? textStyle;
final Color? fillColor;
final double hoverElevation;
final double highlightElevation;
final ValueChanged<String>? onSelected;
final List<HeaderAttribute>? attributes;
final EdgeInsetsGeometry? padding;
final TextStyle? style;
final double? width;
final TextOverflow labelOverflow;
final double? itemHeight;
final EdgeInsets? itemPadding;
final Color? defaultItemColor;
final bool renderItemTextStyle;
QuillToolbarSelectHeaderStyleDropdownButtonOptions copyWith({
Color? fillColor,
double? hoverElevation,
double? highlightElevation,
List<PopupMenuEntry<String>>? items,
ValueChanged<String>? onSelected,
List<HeaderAttribute>? attributes,
EdgeInsetsGeometry? padding,
TextStyle? style,
double? width,
TextOverflow? labelOverflow,
bool? renderFontFamilies,
bool? overrideTooltipByFontFamily,
double? itemHeight,
EdgeInsets? itemPadding,
Color? defaultItemColor,
double? iconSize,
double? iconButtonFactor,
IconData? iconData,
VoidCallback? afterButtonPressed,
String? tooltip,
QuillIconTheme? iconTheme,
bool? renderItemTextStyle,
}) {
return QuillToolbarSelectHeaderStyleDropdownButtonOptions(
attributes: attributes ?? this.attributes,
iconData: iconData ?? this.iconData,
afterButtonPressed: afterButtonPressed ?? this.afterButtonPressed,
tooltip: tooltip ?? this.tooltip,
iconTheme: iconTheme ?? this.iconTheme,
onSelected: onSelected ?? this.onSelected,
padding: padding ?? this.padding,
style: style ?? this.style,
width: width ?? this.width,
labelOverflow: labelOverflow ?? this.labelOverflow,
itemHeight: itemHeight ?? this.itemHeight,
itemPadding: itemPadding ?? this.itemPadding,
defaultItemColor: defaultItemColor ?? this.defaultItemColor,
iconSize: iconSize ?? this.iconSize,
iconButtonFactor: iconButtonFactor ?? this.iconButtonFactor,
fillColor: fillColor ?? this.fillColor,
hoverElevation: hoverElevation ?? this.hoverElevation,
highlightElevation: highlightElevation ?? this.highlightElevation,
renderItemTextStyle: renderItemTextStyle ?? this.renderItemTextStyle,
);
}
}

@ -0,0 +1,136 @@
// ignore_for_file: public_member_api_docs, sort_constructors_first
import 'package:equatable/equatable.dart';
import 'package:flutter/foundation.dart' show immutable;
import 'base_button_configurations.dart';
import 'buttons/clear_format_configurations.dart';
import 'buttons/color_configurations.dart';
import 'buttons/custom_button_configurations.dart';
import 'buttons/font_family_configurations.dart';
import 'buttons/font_size_configurations.dart';
import 'buttons/history_configurations.dart';
import 'buttons/indent_configurations.dart';
import 'buttons/link_style2_configurations.dart';
import 'buttons/link_style_configurations.dart';
import 'buttons/search_configurations.dart';
import 'buttons/select_alignment_configurations.dart';
import 'buttons/select_header_style_buttons_configurations.dart';
import 'buttons/select_header_style_dropdown_button_configurations.dart';
import 'buttons/toggle_check_list_configurations.dart';
import 'buttons/toggle_style_configurations.dart';
export './../../../widgets/toolbar/buttons/search/search_dialog.dart';
export 'base_button_configurations.dart';
export 'buttons/clear_format_configurations.dart';
export 'buttons/color_configurations.dart';
export 'buttons/custom_button_configurations.dart';
export 'buttons/font_family_configurations.dart';
export 'buttons/font_size_configurations.dart';
export 'buttons/history_configurations.dart';
export 'buttons/indent_configurations.dart';
export 'buttons/link_style2_configurations.dart';
export 'buttons/link_style_configurations.dart';
export 'buttons/search_configurations.dart';
export 'buttons/select_alignment_configurations.dart';
export 'buttons/select_header_style_buttons_configurations.dart';
export 'buttons/select_header_style_dropdown_button_configurations.dart';
export 'buttons/toggle_check_list_configurations.dart';
export 'buttons/toggle_style_configurations.dart';
/// The configurations for the buttons of the toolbar widget of flutter quill
@immutable
class QuillSimpleToolbarButtonOptions extends Equatable {
const QuillSimpleToolbarButtonOptions({
this.base = const QuillToolbarBaseButtonOptions(),
this.undoHistory = const QuillToolbarHistoryButtonOptions(),
this.redoHistory = const QuillToolbarHistoryButtonOptions(),
this.fontFamily = const QuillToolbarFontFamilyButtonOptions(),
this.fontSize = const QuillToolbarFontSizeButtonOptions(),
this.bold = const QuillToolbarToggleStyleButtonOptions(),
this.subscript = const QuillToolbarToggleStyleButtonOptions(),
this.superscript = const QuillToolbarToggleStyleButtonOptions(),
this.italic = const QuillToolbarToggleStyleButtonOptions(),
this.small = const QuillToolbarToggleStyleButtonOptions(),
this.underLine = const QuillToolbarToggleStyleButtonOptions(),
this.strikeThrough = const QuillToolbarToggleStyleButtonOptions(),
this.inlineCode = const QuillToolbarToggleStyleButtonOptions(),
this.direction = const QuillToolbarToggleStyleButtonOptions(),
this.listNumbers = const QuillToolbarToggleStyleButtonOptions(),
this.listBullets = const QuillToolbarToggleStyleButtonOptions(),
this.codeBlock = const QuillToolbarToggleStyleButtonOptions(),
this.quote = const QuillToolbarToggleStyleButtonOptions(),
this.toggleCheckList = const QuillToolbarToggleCheckListButtonOptions(),
this.indentIncrease = const QuillToolbarIndentButtonOptions(),
this.indentDecrease = const QuillToolbarIndentButtonOptions(),
this.color = const QuillToolbarColorButtonOptions(),
this.backgroundColor = const QuillToolbarColorButtonOptions(),
this.clearFormat = const QuillToolbarClearFormatButtonOptions(),
this.selectAlignmentButtons =
const QuillToolbarSelectAlignmentButtonOptions(),
this.search = const QuillToolbarSearchButtonOptions(),
this.selectHeaderStyleButtons =
const QuillToolbarSelectHeaderStyleButtonsOptions(),
this.selectHeaderStyleDropdownButton =
const QuillToolbarSelectHeaderStyleDropdownButtonOptions(),
this.linkStyle = const QuillToolbarLinkStyleButtonOptions(),
this.linkStyle2 = const QuillToolbarLinkStyleButton2Options(),
this.customButtons = const QuillToolbarCustomButtonOptions(),
});
/// The base configurations for all the buttons which will apply to all
/// but if the options overrided in the spesefic button options
/// then it will use that instead
final QuillToolbarBaseButtonOptions base;
final QuillToolbarHistoryButtonOptions undoHistory;
final QuillToolbarHistoryButtonOptions redoHistory;
final QuillToolbarFontFamilyButtonOptions fontFamily;
final QuillToolbarFontSizeButtonOptions fontSize;
final QuillToolbarToggleStyleButtonOptions bold;
final QuillToolbarToggleStyleButtonOptions subscript;
final QuillToolbarToggleStyleButtonOptions superscript;
final QuillToolbarToggleStyleButtonOptions italic;
final QuillToolbarToggleStyleButtonOptions small;
final QuillToolbarToggleStyleButtonOptions underLine;
final QuillToolbarToggleStyleButtonOptions strikeThrough;
final QuillToolbarToggleStyleButtonOptions inlineCode;
final QuillToolbarToggleStyleButtonOptions direction;
final QuillToolbarToggleStyleButtonOptions listNumbers;
final QuillToolbarToggleStyleButtonOptions listBullets;
final QuillToolbarToggleStyleButtonOptions codeBlock;
final QuillToolbarToggleStyleButtonOptions quote;
final QuillToolbarToggleCheckListButtonOptions toggleCheckList;
final QuillToolbarIndentButtonOptions indentIncrease;
final QuillToolbarIndentButtonOptions indentDecrease;
final QuillToolbarColorButtonOptions color;
final QuillToolbarColorButtonOptions backgroundColor;
final QuillToolbarClearFormatButtonOptions clearFormat;
/// The reason we call this buttons in the end because this is responsible
/// for all the alignment buttons and not just one, you still
/// can customize the icons and tooltips
/// and you have child builder
final QuillToolbarSelectAlignmentButtonOptions selectAlignmentButtons;
final QuillToolbarSearchButtonOptions search;
/// The reason we call this buttons in the end because this is responsible
/// for all the header style buttons and not just one, you still
/// can customize it and you also have child builder
final QuillToolbarSelectHeaderStyleButtonsOptions selectHeaderStyleButtons;
/// The reason we call this buttons in the end because this is responsible
/// for all the header style buttons and not just one, you still
/// can customize it and you also have child builder
final QuillToolbarSelectHeaderStyleDropdownButtonOptions
selectHeaderStyleDropdownButton;
final QuillToolbarLinkStyleButtonOptions linkStyle;
final QuillToolbarLinkStyleButton2Options linkStyle2;
final QuillToolbarCustomButtonOptions customButtons;
@override
List<Object?> get props => [
base,
];
}

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs, sort_constructors_first
import 'package:equatable/equatable.dart';
import 'package:flutter/foundation.dart' show immutable;
import 'package:flutter/widgets.dart'
show Axis, WrapAlignment, WrapCrossAlignment;
@ -8,22 +6,7 @@ import '../../../widgets/quill/embeds.dart';
import '../../../widgets/quill/quill_controller.dart';
import '../../themes/quill_dialog_theme.dart';
import '../../themes/quill_icon_theme.dart';
import 'base_button_configurations.dart';
import 'buttons/clear_format_configurations.dart';
import 'buttons/color_configurations.dart';
import 'buttons/custom_button_configurations.dart';
import 'buttons/font_family_configurations.dart';
import 'buttons/font_size_configurations.dart';
import 'buttons/history_configurations.dart';
import 'buttons/indent_configurations.dart';
import 'buttons/link_style2_configurations.dart';
import 'buttons/link_style_configurations.dart';
import 'buttons/search_configurations.dart';
import 'buttons/select_alignment_configurations.dart';
import 'buttons/select_header_style_button_configurations.dart';
import 'buttons/select_header_style_buttons_configurations.dart';
import 'buttons/toggle_check_list_configurations.dart';
import 'buttons/toggle_style_configurations.dart';
import 'simple_toolbar_button_options.dart';
import 'toolbar_shared_configurations.dart';
export './../../../widgets/toolbar/buttons/search/search_dialog.dart';
@ -39,10 +22,11 @@ export 'buttons/link_style2_configurations.dart';
export 'buttons/link_style_configurations.dart';
export 'buttons/search_configurations.dart';
export 'buttons/select_alignment_configurations.dart';
export 'buttons/select_header_style_button_configurations.dart';
export 'buttons/select_header_style_buttons_configurations.dart';
export 'buttons/select_header_style_dropdown_button_configurations.dart';
export 'buttons/toggle_check_list_configurations.dart';
export 'buttons/toggle_style_configurations.dart';
export 'simple_toolbar_button_options.dart';
/// The default size of the icon of a button.
const double kDefaultIconSize = 15;
@ -67,6 +51,17 @@ enum LinkStyleType {
bool get isAlternative => this == LinkStyleType.alternative;
}
enum HeaderStyleType {
/// Defines the original [QuillToolbarSelectHeaderStyleButtons].
original,
/// Defines the alternative [QuillToolbarSelectHeaderStyleDropdownButton].
dropdown;
bool get isOriginal => this == HeaderStyleType.original;
bool get isDropdown => this == HeaderStyleType.dropdown;
}
/// The configurations for the toolbar widget of flutter quill
@immutable
class QuillSimpleToolbarConfigurations extends QuillSharedToolbarProperties {
@ -76,7 +71,7 @@ class QuillSimpleToolbarConfigurations extends QuillSharedToolbarProperties {
super.toolbarSectionSpacing = kToolbarSectionSpacing,
super.toolbarIconAlignment = WrapAlignment.center,
super.toolbarIconCrossAlignment = WrapCrossAlignment.center,
super.buttonOptions = const QuillToolbarButtonOptions(),
super.buttonOptions = const QuillSimpleToolbarButtonOptions(),
this.customButtons = const [],
this.fontFamilyValues,
super.multiRowsDisplay = true,
@ -113,6 +108,7 @@ class QuillSimpleToolbarConfigurations extends QuillSharedToolbarProperties {
this.showSubscript = true,
this.showSuperscript = true,
this.linkStyleType = LinkStyleType.original,
this.headerStyleType = HeaderStyleType.original,
/// The decoration to use for the toolbar.
super.decoration,
@ -154,7 +150,7 @@ class QuillSimpleToolbarConfigurations extends QuillSharedToolbarProperties {
final QuillController controller;
/// By default it will be
/// ```
/// ```dart
/// {
/// 'Small'.i18n: 'small',
/// 'Large'.i18n: 'large',
@ -213,6 +209,9 @@ class QuillSimpleToolbarConfigurations extends QuillSharedToolbarProperties {
/// Defines which dialog is used for applying link attribute.
final LinkStyleType linkStyleType;
/// Defines which dialog is used for applying header attribute.
final HeaderStyleType headerStyleType;
@override
List<Object?> get props => [
buttonOptions,
@ -222,100 +221,3 @@ class QuillSimpleToolbarConfigurations extends QuillSharedToolbarProperties {
axis,
];
}
/// The configurations for the buttons of the toolbar widget of flutter quill
@immutable
class QuillToolbarButtonOptions extends Equatable {
const QuillToolbarButtonOptions({
this.base = const QuillToolbarBaseButtonOptions(),
this.undoHistory = const QuillToolbarHistoryButtonOptions(),
this.redoHistory = const QuillToolbarHistoryButtonOptions(),
this.fontFamily = const QuillToolbarFontFamilyButtonOptions(),
this.fontSize = const QuillToolbarFontSizeButtonOptions(),
this.bold = const QuillToolbarToggleStyleButtonOptions(),
this.subscript = const QuillToolbarToggleStyleButtonOptions(),
this.superscript = const QuillToolbarToggleStyleButtonOptions(),
this.italic = const QuillToolbarToggleStyleButtonOptions(),
this.small = const QuillToolbarToggleStyleButtonOptions(),
this.underLine = const QuillToolbarToggleStyleButtonOptions(),
this.strikeThrough = const QuillToolbarToggleStyleButtonOptions(),
this.inlineCode = const QuillToolbarToggleStyleButtonOptions(),
this.direction = const QuillToolbarToggleStyleButtonOptions(),
this.listNumbers = const QuillToolbarToggleStyleButtonOptions(),
this.listBullets = const QuillToolbarToggleStyleButtonOptions(),
this.codeBlock = const QuillToolbarToggleStyleButtonOptions(),
this.quote = const QuillToolbarToggleStyleButtonOptions(),
this.toggleCheckList = const QuillToolbarToggleCheckListButtonOptions(),
this.indentIncrease = const QuillToolbarIndentButtonOptions(),
this.indentDecrease = const QuillToolbarIndentButtonOptions(),
this.color = const QuillToolbarColorButtonOptions(),
this.backgroundColor = const QuillToolbarColorButtonOptions(),
this.clearFormat = const QuillToolbarClearFormatButtonOptions(),
this.selectAlignmentButtons =
const QuillToolbarSelectAlignmentButtonOptions(),
this.search = const QuillToolbarSearchButtonOptions(),
this.selectHeaderStyleButtons =
const QuillToolbarSelectHeaderStyleButtonsOptions(),
this.selectHeaderStyleButton =
const QuillToolbarSelectHeaderStyleButtonOptions(),
this.linkStyle = const QuillToolbarLinkStyleButtonOptions(),
this.linkStyle2 = const QuillToolbarLinkStyleButton2Options(),
this.customButtons = const QuillToolbarCustomButtonOptions(),
});
/// The base configurations for all the buttons which will apply to all
/// but if the options overrided in the spesefic button options
/// then it will use that instead
final QuillToolbarBaseButtonOptions base;
final QuillToolbarHistoryButtonOptions undoHistory;
final QuillToolbarHistoryButtonOptions redoHistory;
final QuillToolbarFontFamilyButtonOptions fontFamily;
final QuillToolbarFontSizeButtonOptions fontSize;
final QuillToolbarToggleStyleButtonOptions bold;
final QuillToolbarToggleStyleButtonOptions subscript;
final QuillToolbarToggleStyleButtonOptions superscript;
final QuillToolbarToggleStyleButtonOptions italic;
final QuillToolbarToggleStyleButtonOptions small;
final QuillToolbarToggleStyleButtonOptions underLine;
final QuillToolbarToggleStyleButtonOptions strikeThrough;
final QuillToolbarToggleStyleButtonOptions inlineCode;
final QuillToolbarToggleStyleButtonOptions direction;
final QuillToolbarToggleStyleButtonOptions listNumbers;
final QuillToolbarToggleStyleButtonOptions listBullets;
final QuillToolbarToggleStyleButtonOptions codeBlock;
final QuillToolbarToggleStyleButtonOptions quote;
final QuillToolbarToggleCheckListButtonOptions toggleCheckList;
final QuillToolbarIndentButtonOptions indentIncrease;
final QuillToolbarIndentButtonOptions indentDecrease;
final QuillToolbarColorButtonOptions color;
final QuillToolbarColorButtonOptions backgroundColor;
final QuillToolbarClearFormatButtonOptions clearFormat;
/// The reason we call this buttons in the end because this is responsible
/// for all the alignment buttons and not just one, you still
/// can customize the icons and tooltips
/// and you have child builder
final QuillToolbarSelectAlignmentButtonOptions selectAlignmentButtons;
final QuillToolbarSearchButtonOptions search;
/// The reason we call this buttons in the end because this is responsible
/// for all the header style buttons and not just one, you still
/// can customize it and you also have child builder
final QuillToolbarSelectHeaderStyleButtonsOptions selectHeaderStyleButtons;
/// The reason we call this buttons in the end because this is responsible
/// for all the header style buttons and not just one, you still
/// can customize it and you also have child builder
final QuillToolbarSelectHeaderStyleButtonOptions selectHeaderStyleButton;
final QuillToolbarLinkStyleButtonOptions linkStyle;
final QuillToolbarLinkStyleButton2Options linkStyle2;
final QuillToolbarCustomButtonOptions customButtons;
@override
List<Object?> get props => [
base,
];
}

@ -1,6 +1,6 @@
import 'package:flutter/widgets.dart' show immutable;
import '../../../widgets/toolbar/base_toolbar.dart';
import 'simple_toolbar_button_options.dart';
import 'toolbar_shared_configurations.dart';
@immutable
@ -10,7 +10,7 @@ class QuillToolbarConfigurations extends QuillSharedToolbarProperties {
/// Note this only used when you using the quill toolbar buttons like
/// `QuillToolbarHistoryButton` inside it
super.buttonOptions = const QuillToolbarButtonOptions(),
super.buttonOptions = const QuillSimpleToolbarButtonOptions(),
});
@override

@ -20,7 +20,7 @@ abstract class QuillSharedToolbarProperties extends Equatable {
this.linkDialogAction,
this.multiRowsDisplay = true,
this.decoration,
this.buttonOptions = const QuillToolbarButtonOptions(),
this.buttonOptions = const QuillSimpleToolbarButtonOptions(),
this.toolbarRunSpacing = 4,
});
final Axis axis;
@ -56,7 +56,7 @@ abstract class QuillSharedToolbarProperties extends Equatable {
/// If you want change spesefic buttons or all of them
/// then you came to the right place
final QuillToolbarButtonOptions buttonOptions;
final QuillSimpleToolbarButtonOptions buttonOptions;
final QuillSharedConfigurations sharedConfigurations;
}

@ -158,12 +158,24 @@ class Attribute<T> extends Equatable {
Attribute.video.key,
};
/// "attributes":{"header": 1 }
static const Attribute<int?> h1 = HeaderAttribute(level: 1);
/// "attributes":{"header": 2 }
static const Attribute<int?> h2 = HeaderAttribute(level: 2);
/// "attributes":{"header": 3 }
static const Attribute<int?> h3 = HeaderAttribute(level: 3);
/// "attributes":{"header": 4 }
static const Attribute<int?> h4 = HeaderAttribute(level: 4);
/// "attributes":{"header": 5 }
static const Attribute<int?> h5 = HeaderAttribute(level: 5);
/// "attributes":{"header": 6 }
static const Attribute<int?> h6 = HeaderAttribute(level: 6);
// "attributes":{"align":"left"}
static const Attribute<String?> leftAlignment = AlignAttribute('left');

@ -67,6 +67,9 @@ class InlineCodeStyle {
this.header1,
this.header2,
this.header3,
this.header4,
this.header5,
this.header6,
this.backgroundColor,
this.radius,
});
@ -83,6 +86,15 @@ class InlineCodeStyle {
/// Style override for inline code in headings level 3.
final TextStyle? header3;
/// Style override for inline code in headings level 4.
final TextStyle? header4;
/// Style override for inline code in headings level 5.
final TextStyle? header5;
/// Style override for inline code in headings level 6.
final TextStyle? header6;
/// Background color for inline code.
final Color? backgroundColor;
@ -101,6 +113,15 @@ class InlineCodeStyle {
if (lineStyle.containsKey(Attribute.h3.key)) {
return header3 ?? style;
}
if (lineStyle.containsKey(Attribute.h4.key)) {
return header4 ?? style;
}
if (lineStyle.containsKey(Attribute.h5.key)) {
return header5 ?? style;
}
if (lineStyle.containsKey(Attribute.h6.key)) {
return header6 ?? style;
}
return style;
}
@ -116,13 +137,16 @@ class InlineCodeStyle {
other.header1 == header1 &&
other.header2 == header2 &&
other.header3 == header3 &&
other.header4 == header4 &&
other.header5 == header5 &&
other.header6 == header6 &&
other.backgroundColor == backgroundColor &&
other.radius == radius;
}
@override
int get hashCode =>
Object.hash(style, header1, header2, header3, backgroundColor, radius);
int get hashCode => Object.hash(style, header1, header2, header3, header4,
header5, header6, backgroundColor, radius);
}
@immutable
@ -144,6 +168,9 @@ class DefaultStyles {
this.h1,
this.h2,
this.h3,
this.h4,
this.h5,
this.h6,
this.paragraph,
this.bold,
this.subscript,
@ -170,6 +197,9 @@ class DefaultStyles {
final DefaultTextBlockStyle? h1;
final DefaultTextBlockStyle? h2;
final DefaultTextBlockStyle? h3;
final DefaultTextBlockStyle? h4;
final DefaultTextBlockStyle? h5;
final DefaultTextBlockStyle? h6;
final DefaultTextBlockStyle? paragraph;
final TextStyle? bold;
final TextStyle? subscript;
@ -220,9 +250,10 @@ class DefaultStyles {
h1: DefaultTextBlockStyle(
defaultTextStyle.style.copyWith(
fontSize: 34,
color: defaultTextStyle.style.color!.withOpacity(0.70),
height: 1.15,
fontWeight: FontWeight.w300,
color: defaultTextStyle.style.color,
letterSpacing: -1,
height: 1,
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
),
const VerticalSpacing(16, 0),
@ -230,10 +261,11 @@ class DefaultStyles {
null),
h2: DefaultTextBlockStyle(
defaultTextStyle.style.copyWith(
fontSize: 24,
color: defaultTextStyle.style.color!.withOpacity(0.70),
height: 1.15,
fontWeight: FontWeight.normal,
fontSize: 30,
color: defaultTextStyle.style.color,
letterSpacing: -0.8,
height: 1.067,
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
),
const VerticalSpacing(8, 0),
@ -241,26 +273,72 @@ class DefaultStyles {
null),
h3: DefaultTextBlockStyle(
defaultTextStyle.style.copyWith(
fontSize: 20,
color: defaultTextStyle.style.color!.withOpacity(0.70),
height: 1.25,
fontWeight: FontWeight.w500,
fontSize: 24,
color: defaultTextStyle.style.color,
letterSpacing: -0.5,
height: 1.083,
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
),
const VerticalSpacing(8, 0),
const VerticalSpacing(0, 0),
null,
),
paragraph: DefaultTextBlockStyle(baseStyle, const VerticalSpacing(0, 0),
const VerticalSpacing(0, 0), null),
h4: DefaultTextBlockStyle(
defaultTextStyle.style.copyWith(
fontSize: 20,
color: defaultTextStyle.style.color,
letterSpacing: -0.4,
height: 1.1,
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
),
const VerticalSpacing(6, 0),
const VerticalSpacing(0, 0),
null,
),
h5: DefaultTextBlockStyle(
defaultTextStyle.style.copyWith(
fontSize: 18,
color: defaultTextStyle.style.color,
letterSpacing: -0.2,
height: 1.11,
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
),
const VerticalSpacing(6, 0),
const VerticalSpacing(0, 0),
null,
),
h6: DefaultTextBlockStyle(
defaultTextStyle.style.copyWith(
fontSize: 16,
color: defaultTextStyle.style.color,
letterSpacing: -0.1,
height: 1.125,
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
),
const VerticalSpacing(4, 0),
const VerticalSpacing(0, 0),
null,
),
paragraph: DefaultTextBlockStyle(
baseStyle,
const VerticalSpacing(0, 0),
const VerticalSpacing(0, 0),
null,
),
bold: const TextStyle(fontWeight: FontWeight.bold),
subscript: const TextStyle(
fontFeatures: [
FontFeature.liningFigures(),
FontFeature.subscripts(),
],
),
superscript: const TextStyle(
fontFeatures: [
FontFeature.liningFigures(),
FontFeature.superscripts(),
],
),
@ -274,9 +352,12 @@ class DefaultStyles {
style: inlineCodeStyle,
header1: inlineCodeStyle.copyWith(
fontSize: 32,
fontWeight: FontWeight.w300,
fontWeight: FontWeight.w500,
),
header2: inlineCodeStyle.copyWith(
fontSize: 22,
fontWeight: FontWeight.w500,
),
header2: inlineCodeStyle.copyWith(fontSize: 22),
header3: inlineCodeStyle.copyWith(
fontSize: 18,
fontWeight: FontWeight.w500,
@ -353,6 +434,9 @@ class DefaultStyles {
h1: other.h1 ?? h1,
h2: other.h2 ?? h2,
h3: other.h3 ?? h3,
h4: other.h4 ?? h4,
h5: other.h5 ?? h5,
h6: other.h6 ?? h6,
paragraph: other.paragraph ?? paragraph,
bold: other.bold ?? bold,
subscript: other.subscript ?? subscript,

@ -312,6 +312,18 @@ class EditableTextBlock extends StatelessWidget {
top = defaultStyles!.h3!.verticalSpacing.top;
bottom = defaultStyles.h3!.verticalSpacing.bottom;
break;
case 4:
top = defaultStyles!.h4!.verticalSpacing.top;
bottom = defaultStyles.h4!.verticalSpacing.bottom;
break;
case 5:
top = defaultStyles!.h5!.verticalSpacing.top;
bottom = defaultStyles.h5!.verticalSpacing.bottom;
break;
case 6:
top = defaultStyles!.h6!.verticalSpacing.top;
bottom = defaultStyles.h6!.verticalSpacing.bottom;
break;
default:
throw ArgumentError('Invalid level $level');
}

@ -276,6 +276,9 @@ class _TextLineState extends State<TextLine> {
Attribute.h1: defaultStyles.h1!.style,
Attribute.h2: defaultStyles.h2!.style,
Attribute.h3: defaultStyles.h3!.style,
Attribute.h4: defaultStyles.h4!.style,
Attribute.h5: defaultStyles.h5!.style,
Attribute.h6: defaultStyles.h6!.style,
};
textStyle = textStyle.merge(m[header] ?? defaultStyles.paragraph!.style);

@ -701,6 +701,21 @@ class QuillRawEditorState extends EditorState
control: !isDesktopMacOS,
meta: isDesktopMacOS,
): const QuillEditorApplyHeaderIntent(Attribute.h3),
SingleActivator(
LogicalKeyboardKey.digit4,
control: !isDesktopMacOS,
meta: isDesktopMacOS,
): const QuillEditorApplyHeaderIntent(Attribute.h4),
SingleActivator(
LogicalKeyboardKey.digit5,
control: !isDesktopMacOS,
meta: isDesktopMacOS,
): const QuillEditorApplyHeaderIntent(Attribute.h5),
SingleActivator(
LogicalKeyboardKey.digit6,
control: !isDesktopMacOS,
meta: isDesktopMacOS,
): const QuillEditorApplyHeaderIntent(Attribute.h6),
SingleActivator(
LogicalKeyboardKey.digit0,
control: !isDesktopMacOS,
@ -1061,6 +1076,12 @@ class QuillRawEditorState extends EditorState
return defaultStyles!.h2!.verticalSpacing;
case 3:
return defaultStyles!.h3!.verticalSpacing;
case 4:
return defaultStyles!.h4!.verticalSpacing;
case 5:
return defaultStyles!.h5!.verticalSpacing;
case 6:
return defaultStyles!.h6!.verticalSpacing;
default:
throw ArgumentError('Invalid level $level');
}

@ -14,7 +14,7 @@ export 'buttons/color/color_button.dart';
export 'buttons/custom_button_button.dart';
export 'buttons/font_family_button.dart';
export 'buttons/font_size_button.dart';
export 'buttons/hearder_style/select_header_style_button.dart';
export 'buttons/hearder_style/select_header_style_dropdown_button.dart';
export 'buttons/hearder_style/select_header_style_buttons.dart';
export 'buttons/history_button.dart';
export 'buttons/indent_button.dart';

@ -7,31 +7,25 @@ import '../../../../models/themes/quill_icon_theme.dart';
import '../../../quill/quill_controller.dart';
import '../../base_toolbar.dart';
enum _HeaderStyleOptions {
normal,
headingOne,
headingTwo,
headingThree,
}
class QuillToolbarSelectHeaderStyleButton extends StatefulWidget {
const QuillToolbarSelectHeaderStyleButton({
class QuillToolbarSelectHeaderStyleDropdownButton extends StatefulWidget {
const QuillToolbarSelectHeaderStyleDropdownButton({
required this.controller,
this.options = const QuillToolbarSelectHeaderStyleButtonOptions(),
this.options = const QuillToolbarSelectHeaderStyleDropdownButtonOptions(),
super.key,
});
final QuillController controller;
final QuillToolbarSelectHeaderStyleButtonOptions options;
final QuillToolbarSelectHeaderStyleDropdownButtonOptions options;
@override
State<QuillToolbarSelectHeaderStyleButton> createState() =>
_QuillToolbarSelectHeaderStyleButtonState();
State<QuillToolbarSelectHeaderStyleDropdownButton> createState() =>
_QuillToolbarSelectHeaderStyleDropdownButtonState();
}
class _QuillToolbarSelectHeaderStyleButtonState
extends State<QuillToolbarSelectHeaderStyleButton> {
var _selectedItem = _HeaderStyleOptions.normal;
class _QuillToolbarSelectHeaderStyleDropdownButtonState
extends State<QuillToolbarSelectHeaderStyleDropdownButton> {
Attribute<dynamic> _selectedItem = Attribute.header;
final _controller = MenuController();
@override
void initState() {
@ -47,7 +41,7 @@ class _QuillToolbarSelectHeaderStyleButtonState
@override
void didUpdateWidget(
covariant QuillToolbarSelectHeaderStyleButton oldWidget) {
covariant QuillToolbarSelectHeaderStyleDropdownButton oldWidget) {
super.didUpdateWidget(oldWidget);
if (oldWidget.controller == widget.controller) {
return;
@ -58,7 +52,7 @@ class _QuillToolbarSelectHeaderStyleButtonState
}
void _didChangeEditingValue() {
final newSelectedItem = _getOptionsItemByAttribute(_getHeaderValue());
final newSelectedItem = _getHeaderValue();
if (newSelectedItem == _selectedItem) {
return;
}
@ -80,36 +74,20 @@ class _QuillToolbarSelectHeaderStyleButtonState
Attribute.header;
}
String _label(_HeaderStyleOptions value) {
String _label(Attribute<dynamic> value) {
final label = switch (value) {
_HeaderStyleOptions.normal => context.loc.normal,
_HeaderStyleOptions.headingOne => context.loc.heading1,
_HeaderStyleOptions.headingTwo => context.loc.heading2,
_HeaderStyleOptions.headingThree => context.loc.heading3,
Attribute.h1 => context.loc.heading1,
Attribute.h2 => context.loc.heading2,
Attribute.h3 => context.loc.heading3,
Attribute.h4 => context.loc.heading4,
Attribute.h5 => context.loc.heading5,
Attribute.h6 => context.loc.heading6,
Attribute.header => context.loc.normal,
Attribute<dynamic>() => throw ArgumentError(),
};
return label;
}
Attribute<dynamic>? getAttributeByOptionsItem(_HeaderStyleOptions option) {
return switch (option) {
_HeaderStyleOptions.normal => Attribute.header,
_HeaderStyleOptions.headingOne => Attribute.h1,
_HeaderStyleOptions.headingTwo => Attribute.h2,
_HeaderStyleOptions.headingThree => Attribute.h3,
};
}
_HeaderStyleOptions _getOptionsItemByAttribute(
Attribute<dynamic>? attribute) {
return switch (attribute) {
Attribute.h1 => _HeaderStyleOptions.headingOne,
Attribute.h2 => _HeaderStyleOptions.headingTwo,
Attribute.h2 => _HeaderStyleOptions.headingThree,
Attribute() => _HeaderStyleOptions.normal,
null => _HeaderStyleOptions.normal,
};
}
double get iconSize {
final baseFontSize = context.quillToolbarBaseButtonOptions?.globalIconSize;
final iconSize = widget.options.iconSize;
@ -128,18 +106,66 @@ class _QuillToolbarSelectHeaderStyleButtonState
context.quillToolbarBaseButtonOptions?.iconTheme;
}
List<Attribute<int?>> get headerAttributes {
return widget.options.attributes ??
[
Attribute.h1,
Attribute.h2,
Attribute.h3,
Attribute.h4,
Attribute.h5,
Attribute.h6,
Attribute.header,
];
}
QuillToolbarBaseButtonOptions get baseButtonExtraOptions {
return context.requireQuillToolbarBaseButtonOptions;
}
VoidCallback? get afterButtonPressed {
return widget.options.afterButtonPressed ??
baseButtonExtraOptions.afterButtonPressed;
}
void _onPressed(Attribute<int?> e) {
setState(() => _selectedItem = e);
widget.controller.formatSelection(_selectedItem);
}
@override
Widget build(BuildContext context) {
final baseButtonConfigurations =
context.requireQuillToolbarBaseButtonOptions;
final childBuilder =
widget.options.childBuilder ?? baseButtonConfigurations.childBuilder;
if (childBuilder != null) {
return childBuilder(
widget.options.copyWith(
iconSize: iconSize,
iconTheme: iconTheme,
afterButtonPressed: afterButtonPressed,
),
QuillToolbarSelectHeaderStyleDropdownButtonExtraOptions(
currentValue: _selectedItem,
context: context,
controller: widget.controller,
onPressed: () {
throw UnimplementedError('Not implemented yet.');
},
),
);
}
return MenuAnchor(
controller: _controller,
menuChildren: _HeaderStyleOptions.values
menuChildren: headerAttributes
.map(
(e) => MenuItemButton(
child: Text(_label(e)),
onPressed: () {
widget.controller.formatSelection(getAttributeByOptionsItem(e));
setState(() => _selectedItem = e);
_onPressed(e);
},
child: Text(_label(e)),
),
)
.toList(),

@ -196,10 +196,10 @@ class QuillSimpleToolbar extends StatelessWidget
space: configurations.sectionDividerSpace,
),
if (configurations.showHeaderStyle)
QuillToolbarSelectHeaderStyleButton(
QuillToolbarSelectHeaderStyleDropdownButton(
controller: globalController,
options:
toolbarConfigurations.buttonOptions.selectHeaderStyleButton,
options: toolbarConfigurations
.buttonOptions.selectHeaderStyleDropdownButton,
),
if (configurations.showDividers &&
configurations.showHeaderStyle &&

Loading…
Cancel
Save