Update the example

pull/1596/head
Ellet 1 year ago
parent 4eaf278956
commit dd5b802fee
No known key found for this signature in database
GPG Key ID: C488CC70BBCEF0D1
  1. 3
      CHANGELOG.md
  2. 11
      example/lib/presentation/quill/my_quill_toolbar.dart
  3. 4
      lib/src/models/config/toolbar/buttons/select_header_style_button_configurations.dart
  4. 1
      lib/src/models/config/toolbar/simple_toolbar_configurations.dart
  5. 14
      lib/src/widgets/toolbar/buttons/hearder_style/select_header_style_button.dart
  6. 2
      version.dart

@ -2,6 +2,9 @@
All notable changes to this project will be documented in this file.
## 9.0.2-dev.1
* Add configurations for the new dropdown `QuillToolbarSelectHeaderStyleButton`, you can use the orignal one or this
## 9.0.2-dev
* **Breaking change** Remove the spacer widget, removed the controller option for each button
* Add `toolbarRunSpacing` property to the simple toolbar

@ -205,7 +205,16 @@ class MyQuillToolbar extends StatelessWidget {
base: QuillToolbarBaseButtonOptions(
// Request editor focus when any button is pressed
afterButtonPressed: focusNode.requestFocus,
globalIconSize: 30,
globalIconSize: 18,
),
selectHeaderStyleButton:
const QuillToolbarSelectHeaderStyleButtonOptions(
textStyle: TextStyle(
fontSize: 20,
),
iconTheme: QuillIconTheme(
iconSelectedColor: Colors.red,
),
),
),
customButtons: [

@ -1,3 +1,5 @@
import 'package:flutter/widgets.dart' show TextStyle;
import '../../../../widgets/toolbar/base_toolbar.dart';
class QuillToolbarSelectHeaderStyleButtonExtraOptions
@ -20,9 +22,11 @@ class QuillToolbarSelectHeaderStyleButtonOptions
super.tooltip,
this.iconSize,
this.iconButtonFactor,
this.textStyle,
});
/// By default we will the toolbar axis from [QuillSimpleToolbarConfigurations]
final double? iconSize;
final double? iconButtonFactor;
final TextStyle? textStyle;
}

@ -39,6 +39,7 @@ export 'buttons/link_style2_configurations.dart';
export 'buttons/link_style_configurations.dart';
export 'buttons/search_configurations.dart';
export 'buttons/select_alignment_configurations.dart';
export 'buttons/select_header_style_button_configurations.dart';
export 'buttons/select_header_style_buttons_configurations.dart';
export 'buttons/toggle_check_list_configurations.dart';
export 'buttons/toggle_style_configurations.dart';

@ -4,6 +4,7 @@ import '../../../../../translations.dart';
import '../../../../extensions/quill_configurations_ext.dart';
import '../../../../models/config/toolbar/buttons/select_header_style_button_configurations.dart';
import '../../../../models/documents/attribute.dart';
import '../../../../models/themes/quill_icon_theme.dart';
import '../../../quill/quill_controller.dart';
import '../../base_toolbar.dart';
@ -123,6 +124,11 @@ class _QuillToolbarSelectHeaderStyleButtonState
return iconButtonFactor ?? baseIconFactor ?? kIconButtonFactor;
}
QuillIconTheme? get iconTheme {
return widget.options.iconTheme ??
context.quillToolbarBaseButtonOptions?.iconTheme;
}
@override
Widget build(BuildContext context) {
return MenuAnchor(
@ -149,7 +155,13 @@ class _QuillToolbarSelectHeaderStyleButtonState
icon: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(_label(_selectedItem)),
Text(
_label(_selectedItem),
style: widget.options.textStyle ??
TextStyle(
fontSize: iconSize / 1.15,
),
),
Icon(
Icons.arrow_drop_down,
size: iconSize * iconButtonFactor,

@ -1 +1 @@
const version = '9.0.2-dev';
const version = '9.0.2-dev.1';

Loading…
Cancel
Save