Fix history button

pull/1634/head
Ellet 1 year ago
parent 8d818ed97b
commit 9292e4ef14
  1. 9
      example/lib/presentation/quill/my_quill_toolbar.dart
  2. 4
      lib/src/widgets/toolbar/buttons/history_button.dart
  3. 10
      lib/src/widgets/toolbar/buttons/quill_icon_button.dart

@ -201,14 +201,7 @@ class MyQuillToolbar extends StatelessWidget {
configurations: QuillSimpleToolbarConfigurations(
controller: controller,
showAlignmentButtons: true,
multiRowsDisplay: false,
buttonOptions: QuillSimpleToolbarButtonOptions(
base: QuillToolbarBaseButtonOptions(
// Request editor focus when any button is pressed
afterButtonPressed: focusNode.requestFocus,
// globalIconSize: 18,
),
),
multiRowsDisplay: true,
customButtons: [
QuillToolbarCustomButtonOptions(
icon: const Icon(Icons.add_alarm_rounded),

@ -103,10 +103,10 @@ class QuillToolbarHistoryButtonState extends State<QuillToolbarHistoryButton> {
iconData,
size: iconSize * iconButtonFactor,
),
isSelected: _canPressed,
isSelected: false,
iconSelectedStyle: iconTheme?.iconButtonSelectedStyle,
iconUnselectedStyle: iconTheme?.iconButtonUnselectedStyle,
onPressed: _updateHistory,
onPressed: _canPressed ? _updateHistory : null,
afterPressed: afterButtonPressed,
);
}

@ -35,10 +35,12 @@ class QuillToolbarIconButton extends StatelessWidget {
}
return IconButton(
padding: padding,
onPressed: () {
onPressed?.call();
afterPressed?.call();
},
onPressed: onPressed != null
? () {
onPressed?.call();
afterPressed?.call();
}
: null,
icon: icon,
style: iconUnselectedStyle,
);

Loading…
Cancel
Save