diff --git a/CHANGELOG.md b/CHANGELOG.md index 40e96aa8..eed8effb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ +# [7.1.12] +- Add superscript and subscript styles. + # [7.1.11] -- Add inserting indents for lines of list if text is selected +- Add inserting indents for lines of list if text is selected. # [7.1.10] - Image embedding tweaks diff --git a/flutter_quill_extensions/pubspec.yaml b/flutter_quill_extensions/pubspec.yaml index 48ac50ac..0d29645d 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.10 + flutter_quill: ^7.1.12 file_picker: ^5.2.10 image_picker: ^0.8.7+3 diff --git a/lib/src/models/documents/attribute.dart b/lib/src/models/documents/attribute.dart index b1df087f..6c48e59e 100644 --- a/lib/src/models/documents/attribute.dart +++ b/lib/src/models/documents/attribute.dart @@ -50,9 +50,11 @@ class Attribute { static const BoldAttribute bold = BoldAttribute(); - static final ScriptAttribute subscript = ScriptAttribute(ScriptAttributes.sub); + static final ScriptAttribute subscript = + ScriptAttribute(ScriptAttributes.sub); - static final ScriptAttribute superscript = ScriptAttribute(ScriptAttributes.sup); + static final ScriptAttribute superscript = + ScriptAttribute(ScriptAttributes.sup); static const ItalicAttribute italic = ItalicAttribute(); diff --git a/lib/src/widgets/text_line.dart b/lib/src/widgets/text_line.dart index 86c35da8..28e70e2c 100644 --- a/lib/src/widgets/text_line.dart +++ b/lib/src/widgets/text_line.dart @@ -355,7 +355,7 @@ class _TextLineState extends State { if (nodeStyle.containsKey(Attribute.script.key)) { if (nodeStyle.attributes.values.contains(Attribute.subscript)) { res = _merge(res, defaultStyles.subscript!); - }else if (nodeStyle.attributes.values.contains(Attribute.superscript)) { + } else if (nodeStyle.attributes.values.contains(Attribute.superscript)) { res = _merge(res, defaultStyles.superscript!); } } diff --git a/lib/src/widgets/toolbar.dart b/lib/src/widgets/toolbar.dart index bc08c027..e4da8149 100644 --- a/lib/src/widgets/toolbar.dart +++ b/lib/src/widgets/toolbar.dart @@ -300,7 +300,6 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { iconTheme: iconTheme, afterButtonPressed: afterButtonPressed, ), - if (showSubscript) ToggleStyleButton( attribute: Attribute.subscript, @@ -311,7 +310,6 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { iconTheme: iconTheme, afterButtonPressed: afterButtonPressed, ), - if (showSuperscript) ToggleStyleButton( attribute: Attribute.superscript, @@ -322,7 +320,6 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget { iconTheme: iconTheme, afterButtonPressed: afterButtonPressed, ), - if (showItalicButton) ToggleStyleButton( attribute: Attribute.italic, diff --git a/lib/src/widgets/toolbar/toggle_style_button.dart b/lib/src/widgets/toolbar/toggle_style_button.dart index 6800cc7b..53099743 100644 --- a/lib/src/widgets/toolbar/toggle_style_button.dart +++ b/lib/src/widgets/toolbar/toggle_style_button.dart @@ -105,7 +105,8 @@ class _ToggleStyleButtonState extends State { } bool _getIsToggled(Map attrs) { - if (widget.attribute.key == Attribute.list.key || widget.attribute.key == Attribute.script.key) { + if (widget.attribute.key == Attribute.list.key || + widget.attribute.key == Attribute.script.key) { final attribute = attrs[widget.attribute.key]; if (attribute == null) { return false; diff --git a/pubspec.yaml b/pubspec.yaml index 7d497da1..316c44ce 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.11 +version: 7.1.12 #author: bulletjournal homepage: https://bulletjournal.us/home/index.html repository: https://github.com/singerdmx/flutter-quill