Use correct dividers for vertical toolbar

pull/1101/head
Adil Hanney 2 years ago
parent 31770f51d9
commit 19187e9c9a
No known key found for this signature in database
GPG Key ID: 27A0885BC5740457
  1. 52
      lib/src/widgets/toolbar.dart

@ -337,11 +337,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
isButtonGroupShown[3] || isButtonGroupShown[3] ||
isButtonGroupShown[4] || isButtonGroupShown[4] ||
isButtonGroupShown[5])) isButtonGroupShown[5]))
VerticalDivider( _dividerOnAxis(axis),
indent: 12,
endIndent: 12,
color: Colors.grey.shade400,
),
if (showAlignmentButtons) if (showAlignmentButtons)
SelectAlignmentButton( SelectAlignmentButton(
controller: controller, controller: controller,
@ -368,11 +364,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
isButtonGroupShown[3] || isButtonGroupShown[3] ||
isButtonGroupShown[4] || isButtonGroupShown[4] ||
isButtonGroupShown[5])) isButtonGroupShown[5]))
VerticalDivider( _dividerOnAxis(axis),
indent: 12,
endIndent: 12,
color: Colors.grey.shade400,
),
if (showHeaderStyle) if (showHeaderStyle)
SelectHeaderStyleButton( SelectHeaderStyleButton(
controller: controller, controller: controller,
@ -387,11 +379,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
(isButtonGroupShown[3] || (isButtonGroupShown[3] ||
isButtonGroupShown[4] || isButtonGroupShown[4] ||
isButtonGroupShown[5])) isButtonGroupShown[5]))
VerticalDivider( _dividerOnAxis(axis),
indent: 12,
endIndent: 12,
color: Colors.grey.shade400,
),
if (showListNumbers) if (showListNumbers)
ToggleStyleButton( ToggleStyleButton(
attribute: Attribute.ol, attribute: Attribute.ol,
@ -431,11 +419,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
if (showDividers && if (showDividers &&
isButtonGroupShown[3] && isButtonGroupShown[3] &&
(isButtonGroupShown[4] || isButtonGroupShown[5])) (isButtonGroupShown[4] || isButtonGroupShown[5]))
VerticalDivider( _dividerOnAxis(axis),
indent: 12,
endIndent: 12,
color: Colors.grey.shade400,
),
if (showQuote) if (showQuote)
ToggleStyleButton( ToggleStyleButton(
attribute: Attribute.blockQuote, attribute: Attribute.blockQuote,
@ -464,11 +448,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
afterButtonPressed: afterButtonPressed, afterButtonPressed: afterButtonPressed,
), ),
if (showDividers && isButtonGroupShown[4] && isButtonGroupShown[5]) if (showDividers && isButtonGroupShown[4] && isButtonGroupShown[5])
VerticalDivider( _dividerOnAxis(axis),
indent: 12,
endIndent: 12,
color: Colors.grey.shade400,
),
if (showLink) if (showLink)
LinkStyleButton( LinkStyleButton(
controller: controller, controller: controller,
@ -488,11 +468,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
), ),
if (customButtons.isNotEmpty) if (customButtons.isNotEmpty)
if (showDividers) if (showDividers)
VerticalDivider( _dividerOnAxis(axis),
indent: 12,
endIndent: 12,
color: Colors.grey.shade400,
),
for (var customButton in customButtons) for (var customButton in customButtons)
QuillIconButton( QuillIconButton(
highlightElevation: 0, highlightElevation: 0,
@ -507,6 +483,22 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
); );
} }
static Widget _dividerOnAxis(Axis axis) {
if (axis == Axis.horizontal) {
return const VerticalDivider(
indent: 12,
endIndent: 12,
color: Colors.grey,
);
} else {
return const Divider(
indent: 12,
endIndent: 12,
color: Colors.grey,
);
}
}
final List<Widget> children; final List<Widget> children;
final Axis axis; final Axis axis;
final double toolbarSize; final double toolbarSize;

Loading…
Cancel
Save