Fix direction of toolbar dividers (#1202)

pull/1204/head
Adil Hanney 2 years ago committed by GitHub
parent d4aaea239f
commit 6614030ae5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      CHANGELOG.md
  2. 2
      flutter_quill_extensions/pubspec.yaml
  3. 25
      lib/src/widgets/toolbar.dart
  4. 2
      pubspec.yaml

@ -1,3 +1,6 @@
# [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] # [7.1.14]
- Add indents change for multiline selection. - Add indents change for multiline selection.

@ -12,7 +12,7 @@ dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
flutter_quill: ^7.1.12 flutter_quill: ^7.1.15
image_picker: ^0.8.5+3 image_picker: ^0.8.5+3
photo_view: ^0.14.0 photo_view: ^0.14.0

@ -409,7 +409,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
isButtonGroupShown[3] || isButtonGroupShown[3] ||
isButtonGroupShown[4] || isButtonGroupShown[4] ||
isButtonGroupShown[5])) isButtonGroupShown[5]))
AxisDivider(axis, _AxisDivider(axis,
color: sectionDividerColor, space: sectionDividerSpace), color: sectionDividerColor, space: sectionDividerSpace),
if (showAlignmentButtons) if (showAlignmentButtons)
SelectAlignmentButton( SelectAlignmentButton(
@ -445,7 +445,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
isButtonGroupShown[3] || isButtonGroupShown[3] ||
isButtonGroupShown[4] || isButtonGroupShown[4] ||
isButtonGroupShown[5])) isButtonGroupShown[5]))
AxisDivider(axis, _AxisDivider(axis,
color: sectionDividerColor, space: sectionDividerSpace), color: sectionDividerColor, space: sectionDividerSpace),
if (showHeaderStyle) if (showHeaderStyle)
SelectHeaderStyleButton( SelectHeaderStyleButton(
@ -462,7 +462,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
(isButtonGroupShown[3] || (isButtonGroupShown[3] ||
isButtonGroupShown[4] || isButtonGroupShown[4] ||
isButtonGroupShown[5])) isButtonGroupShown[5]))
AxisDivider(axis, _AxisDivider(axis,
color: sectionDividerColor, space: sectionDividerSpace), color: sectionDividerColor, space: sectionDividerSpace),
if (showListNumbers) if (showListNumbers)
ToggleStyleButton( ToggleStyleButton(
@ -507,7 +507,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
if (showDividers && if (showDividers &&
isButtonGroupShown[3] && isButtonGroupShown[3] &&
(isButtonGroupShown[4] || isButtonGroupShown[5])) (isButtonGroupShown[4] || isButtonGroupShown[5]))
AxisDivider(axis, _AxisDivider(axis,
color: sectionDividerColor, space: sectionDividerSpace), color: sectionDividerColor, space: sectionDividerSpace),
if (showQuote) if (showQuote)
ToggleStyleButton( ToggleStyleButton(
@ -540,7 +540,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
afterButtonPressed: afterButtonPressed, afterButtonPressed: afterButtonPressed,
), ),
if (showDividers && isButtonGroupShown[4] && isButtonGroupShown[5]) if (showDividers && isButtonGroupShown[4] && isButtonGroupShown[5])
AxisDivider(axis, _AxisDivider(axis,
color: sectionDividerColor, space: sectionDividerSpace), color: sectionDividerColor, space: sectionDividerSpace),
if (showLink) if (showLink)
LinkStyleButton( LinkStyleButton(
@ -563,7 +563,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
), ),
if (customButtons.isNotEmpty) if (customButtons.isNotEmpty)
if (showDividers) if (showDividers)
AxisDivider(axis, _AxisDivider(axis,
color: sectionDividerColor, space: sectionDividerSpace), color: sectionDividerColor, space: sectionDividerSpace),
for (var customButton in customButtons) for (var customButton in customButtons)
QuillIconButton( QuillIconButton(
@ -643,27 +643,22 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
} }
} }
class AxisDivider extends StatelessWidget { class _AxisDivider extends StatelessWidget {
const AxisDivider( const _AxisDivider(
this.axis, { this.axis, {
Key? key, Key? key,
this.color, this.color,
this.space, this.space,
}) : super(key: key); }) : super(key: key);
const AxisDivider.horizontal({Color? color, double? space})
: this(Axis.horizontal, color: color, space: space);
const AxisDivider.vertical({Color? color, double? space})
: this(Axis.vertical, color: color, space: space);
final Axis axis; final Axis axis;
final Color? color; final Color? color;
final double? space; final double? space;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return axis == Axis.horizontal // Vertical toolbar requires horizontal divider, and vice versa
return axis == Axis.vertical
? Divider( ? Divider(
height: space, height: space,
color: color, color: color,

@ -1,6 +1,6 @@
name: flutter_quill name: flutter_quill
description: A rich text editor supporting mobile and web (Demo App @ bulletjournal.us) description: A rich text editor supporting mobile and web (Demo App @ bulletjournal.us)
version: 7.1.14 version: 7.1.15
#author: bulletjournal #author: bulletjournal
homepage: https://bulletjournal.us/home/index.html homepage: https://bulletjournal.us/home/index.html
repository: https://github.com/singerdmx/flutter-quill repository: https://github.com/singerdmx/flutter-quill

Loading…
Cancel
Save