format code

pull/463/head
li3317 3 years ago
parent 733c9bd1b0
commit 2db1cc931b
  1. 8
      lib/src/widgets/toolbar.dart
  2. 19
      lib/src/widgets/toolbar/select_alignment_button.dart

@ -137,7 +137,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
showLeftAlignment,
showCenterAlignment,
showRightAlignment,
showJustifyAlignment,
showJustifyAlignment,
showHeaderStyle,
showListNumbers || showListBullets || showListCheck || showCodeBlock,
showQuote || showIndent,
@ -290,9 +290,9 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
controller: controller,
iconSize: toolbarIconSize,
iconTheme: iconTheme,
showLeftAlignment: showLeftAlignment,
showCenterAlignment: showCenterAlignment,
showRightAlignment: showRightAlignment,
showLeftAlignment: showLeftAlignment,
showCenterAlignment: showCenterAlignment,
showRightAlignment: showRightAlignment,
showJustifyAlignment: showJustifyAlignment,
),
if (isButtonGroupShown[1] &&

@ -50,10 +50,14 @@ class _SelectAlignmentButtonState extends State<SelectAlignmentButton> {
@override
Widget build(BuildContext context) {
final _valueToText = <Attribute, String>{
if (widget.showLeftAlignment!) Attribute.leftAlignment: Attribute.leftAlignment.value!,
if (widget.showCenterAlignment!) Attribute.centerAlignment: Attribute.centerAlignment.value!,
if (widget.showRightAlignment!) Attribute.rightAlignment: Attribute.rightAlignment.value!,
if (widget.showJustifyAlignment!) Attribute.justifyAlignment: Attribute.justifyAlignment.value!,
if (widget.showLeftAlignment!)
Attribute.leftAlignment: Attribute.leftAlignment.value!,
if (widget.showCenterAlignment!)
Attribute.centerAlignment: Attribute.centerAlignment.value!,
if (widget.showRightAlignment!)
Attribute.rightAlignment: Attribute.rightAlignment.value!,
if (widget.showJustifyAlignment!)
Attribute.justifyAlignment: Attribute.justifyAlignment.value!,
};
final _valueAttribute = <Attribute>[
@ -70,8 +74,11 @@ class _SelectAlignmentButtonState extends State<SelectAlignmentButton> {
];
final theme = Theme.of(context);
final buttonCount = ((widget.showLeftAlignment!) ? 1 : 0) + ((widget.showCenterAlignment!) ? 1 : 0) + ((widget.showRightAlignment!) ? 1 : 0) + ((widget.showJustifyAlignment!) ? 1 : 0);
final buttonCount = ((widget.showLeftAlignment!) ? 1 : 0) +
((widget.showCenterAlignment!) ? 1 : 0) +
((widget.showRightAlignment!) ? 1 : 0) +
((widget.showJustifyAlignment!) ? 1 : 0);
return Row(
mainAxisSize: MainAxisSize.min,

Loading…
Cancel
Save