diff --git a/CHANGELOG.md b/CHANGELOG.md index e97089e9..46b9b977 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# [7.1.17] +- Updates `device_info_plus` to version 9.0.0 to benefit from AGP 8 (see [changelog#900](https://pub.dev/packages/device_info_plus/changelog#900)). + +# [7.1.16] +- Fixed subscript key from 'sup' to 'sub'. + +# [7.1.15] +- Fixed a bug introduced in 7.1.7 where each section in `QuillToolbar` was displayed on its own line. + # [7.1.14] - Add indents change for multiline selection. diff --git a/flutter_quill_extensions/pubspec.yaml b/flutter_quill_extensions/pubspec.yaml index 12ab6b52..f03c97c7 100644 --- a/flutter_quill_extensions/pubspec.yaml +++ b/flutter_quill_extensions/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: flutter: sdk: flutter - flutter_quill: ^7.1.12 + flutter_quill: ^7.1.17 image_picker: ^0.8.5+3 photo_view: ^0.14.0 diff --git a/lib/src/models/documents/attribute.dart b/lib/src/models/documents/attribute.dart index 6c48e59e..c8d40360 100644 --- a/lib/src/models/documents/attribute.dart +++ b/lib/src/models/documents/attribute.dart @@ -373,7 +373,7 @@ class ScriptAttribute extends Attribute { enum ScriptAttributes { sup('super'), - sub('sup'); + sub('sub'); const ScriptAttributes(this.value); diff --git a/lib/src/widgets/text_line.dart b/lib/src/widgets/text_line.dart index f4dbc899..f38cbebf 100644 --- a/lib/src/widgets/text_line.dart +++ b/lib/src/widgets/text_line.dart @@ -282,7 +282,7 @@ class _TextLineState extends State { toMerge = defaultStyles.quote!.style; } else if (block == Attribute.codeBlock) { toMerge = defaultStyles.code!.style; - } else if (block == Attribute.list) { + } else if (block?.key == Attribute.list.key) { toMerge = defaultStyles.lists!.style; } diff --git a/lib/src/widgets/toolbar.dart b/lib/src/widgets/toolbar.dart index e4da8149..f1cb3d96 100644 --- a/lib/src/widgets/toolbar.dart +++ b/lib/src/widgets/toolbar.dart @@ -409,7 +409,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { isButtonGroupShown[3] || isButtonGroupShown[4] || isButtonGroupShown[5])) - AxisDivider(axis, + QuillDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), if (showAlignmentButtons) SelectAlignmentButton( @@ -445,7 +445,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { isButtonGroupShown[3] || isButtonGroupShown[4] || isButtonGroupShown[5])) - AxisDivider(axis, + QuillDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), if (showHeaderStyle) SelectHeaderStyleButton( @@ -462,7 +462,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { (isButtonGroupShown[3] || isButtonGroupShown[4] || isButtonGroupShown[5])) - AxisDivider(axis, + QuillDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), if (showListNumbers) ToggleStyleButton( @@ -507,7 +507,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { if (showDividers && isButtonGroupShown[3] && (isButtonGroupShown[4] || isButtonGroupShown[5])) - AxisDivider(axis, + QuillDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), if (showQuote) ToggleStyleButton( @@ -540,7 +540,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { afterButtonPressed: afterButtonPressed, ), if (showDividers && isButtonGroupShown[4] && isButtonGroupShown[5]) - AxisDivider(axis, + QuillDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), if (showLink) LinkStyleButton( @@ -563,7 +563,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { ), if (customButtons.isNotEmpty) if (showDividers) - AxisDivider(axis, + QuillDivider(axis, color: sectionDividerColor, space: sectionDividerSpace), for (var customButton in customButtons) QuillIconButton( @@ -643,27 +643,39 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { } } -class AxisDivider extends StatelessWidget { - const AxisDivider( +/// The divider which is used for separation of buttons in the toolbar. +/// +/// It can be used outside of this package, for example when user does not use +/// [QuillToolbar.basic] and compose toolbat's children on its own. +class QuillDivider extends StatelessWidget { + const QuillDivider( this.axis, { Key? key, this.color, this.space, }) : super(key: key); - const AxisDivider.horizontal({Color? color, double? space}) + /// Provides a horizonal divider for vertical toolbar. + const QuillDivider.horizontal({Color? color, double? space}) : this(Axis.horizontal, color: color, space: space); - const AxisDivider.vertical({Color? color, double? space}) + /// Provides a horizonal divider for horizontal toolbar. + const QuillDivider.vertical({Color? color, double? space}) : this(Axis.vertical, color: color, space: space); + /// The axis along which the toolbar is. final Axis axis; + + /// The color to use when painting this divider's line. final Color? color; + + /// The divider's space (width or height) depending of [axis]. final double? space; @override Widget build(BuildContext context) { - return axis == Axis.horizontal + // Vertical toolbar requires horizontal divider, and vice versa + return axis == Axis.vertical ? Divider( height: space, color: color, diff --git a/pubspec.yaml b/pubspec.yaml index 43a4ec74..0a369e47 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_quill description: A rich text editor supporting mobile and web (Demo App @ bulletjournal.us) -version: 7.1.14 +version: 7.1.17+1 #author: bulletjournal homepage: https://bulletjournal.us/home/index.html repository: https://github.com/singerdmx/flutter-quill @@ -21,7 +21,7 @@ dependencies: characters: ^1.2.1 diff_match_patch: ^0.4.1 i18n_extension: ^8.0.0 - device_info_plus: ^8.1.0 + device_info_plus: ^9.0.0 platform: ^3.1.0 pasteboard: ^0.2.0