Skip to content

Commit 6614030

Browse files
authored
Fix direction of toolbar dividers (singerdmx#1202)
1 parent d4aaea2 commit 6614030

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# [7.1.15]
2+
- Fixed a bug introduced in 7.1.7 where each section in `QuillToolbar` was displayed on its own line.
3+
14
# [7.1.14]
25
- Add indents change for multiline selection.
36

flutter_quill_extensions/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies:
1212
flutter:
1313
sdk: flutter
1414

15-
flutter_quill: ^7.1.12
15+
flutter_quill: ^7.1.15
1616

1717
image_picker: ^0.8.5+3
1818
photo_view: ^0.14.0

lib/src/widgets/toolbar.dart

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
409409
isButtonGroupShown[3] ||
410410
isButtonGroupShown[4] ||
411411
isButtonGroupShown[5]))
412-
AxisDivider(axis,
412+
_AxisDivider(axis,
413413
color: sectionDividerColor, space: sectionDividerSpace),
414414
if (showAlignmentButtons)
415415
SelectAlignmentButton(
@@ -445,7 +445,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
445445
isButtonGroupShown[3] ||
446446
isButtonGroupShown[4] ||
447447
isButtonGroupShown[5]))
448-
AxisDivider(axis,
448+
_AxisDivider(axis,
449449
color: sectionDividerColor, space: sectionDividerSpace),
450450
if (showHeaderStyle)
451451
SelectHeaderStyleButton(
@@ -462,7 +462,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
462462
(isButtonGroupShown[3] ||
463463
isButtonGroupShown[4] ||
464464
isButtonGroupShown[5]))
465-
AxisDivider(axis,
465+
_AxisDivider(axis,
466466
color: sectionDividerColor, space: sectionDividerSpace),
467467
if (showListNumbers)
468468
ToggleStyleButton(
@@ -507,7 +507,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
507507
if (showDividers &&
508508
isButtonGroupShown[3] &&
509509
(isButtonGroupShown[4] || isButtonGroupShown[5]))
510-
AxisDivider(axis,
510+
_AxisDivider(axis,
511511
color: sectionDividerColor, space: sectionDividerSpace),
512512
if (showQuote)
513513
ToggleStyleButton(
@@ -540,7 +540,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
540540
afterButtonPressed: afterButtonPressed,
541541
),
542542
if (showDividers && isButtonGroupShown[4] && isButtonGroupShown[5])
543-
AxisDivider(axis,
543+
_AxisDivider(axis,
544544
color: sectionDividerColor, space: sectionDividerSpace),
545545
if (showLink)
546546
LinkStyleButton(
@@ -563,7 +563,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
563563
),
564564
if (customButtons.isNotEmpty)
565565
if (showDividers)
566-
AxisDivider(axis,
566+
_AxisDivider(axis,
567567
color: sectionDividerColor, space: sectionDividerSpace),
568568
for (var customButton in customButtons)
569569
QuillIconButton(
@@ -643,27 +643,22 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
643643
}
644644
}
645645

646-
class AxisDivider extends StatelessWidget {
647-
const AxisDivider(
646+
class _AxisDivider extends StatelessWidget {
647+
const _AxisDivider(
648648
this.axis, {
649649
Key? key,
650650
this.color,
651651
this.space,
652652
}) : super(key: key);
653653

654-
const AxisDivider.horizontal({Color? color, double? space})
655-
: this(Axis.horizontal, color: color, space: space);
656-
657-
const AxisDivider.vertical({Color? color, double? space})
658-
: this(Axis.vertical, color: color, space: space);
659-
660654
final Axis axis;
661655
final Color? color;
662656
final double? space;
663657

664658
@override
665659
Widget build(BuildContext context) {
666-
return axis == Axis.horizontal
660+
// Vertical toolbar requires horizontal divider, and vice versa
661+
return axis == Axis.vertical
667662
? Divider(
668663
height: space,
669664
color: color,

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_quill
22
description: A rich text editor supporting mobile and web (Demo App @ bulletjournal.us)
3-
version: 7.1.14
3+
version: 7.1.15
44
#author: bulletjournal
55
homepage: https://bulletjournal.us/home/index.html
66
repository: https://github.com/singerdmx/flutter-quill

0 commit comments

Comments
 (0)