From 5004b66a48d75db499ffc03e62a2e6265f01291e Mon Sep 17 00:00:00 2001 From: Ellet Date: Sun, 17 Dec 2023 00:17:06 +0300 Subject: [PATCH] Prepare to release 9.0.2 --- CHANGELOG.md | 3 +- flutter_quill_extensions/CHANGELOG.md | 3 +- flutter_quill_test/CHANGELOG.md | 3 +- .../toolbar/buttons/font_family_button.dart | 37 +++++++---- .../toolbar/buttons/font_size_button.dart | 39 +++++++----- .../select_header_style_dropdown_button.dart | 62 ++++++++++++------- quill_html_converter/CHANGELOG.md | 3 +- 7 files changed, 94 insertions(+), 56 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb368a9b..fcd4ebd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,8 @@ All notable changes to this project will be documented in this file. ## 9.0.2 -* Release instead of pre-release +* Remove unused properties in the `QuillToolbarSelectHeaderStyleDropdownButton` +* Fix the `QuillSimpleToolbar` when `useMaterial3` is false, please upgrade to the latest version of flutter for better support ## 9.0.2-dev.3 * Export `QuillSingleChildScrollView` diff --git a/flutter_quill_extensions/CHANGELOG.md b/flutter_quill_extensions/CHANGELOG.md index cb368a9b..fcd4ebd5 100644 --- a/flutter_quill_extensions/CHANGELOG.md +++ b/flutter_quill_extensions/CHANGELOG.md @@ -3,7 +3,8 @@ All notable changes to this project will be documented in this file. ## 9.0.2 -* Release instead of pre-release +* Remove unused properties in the `QuillToolbarSelectHeaderStyleDropdownButton` +* Fix the `QuillSimpleToolbar` when `useMaterial3` is false, please upgrade to the latest version of flutter for better support ## 9.0.2-dev.3 * Export `QuillSingleChildScrollView` diff --git a/flutter_quill_test/CHANGELOG.md b/flutter_quill_test/CHANGELOG.md index cb368a9b..fcd4ebd5 100644 --- a/flutter_quill_test/CHANGELOG.md +++ b/flutter_quill_test/CHANGELOG.md @@ -3,7 +3,8 @@ All notable changes to this project will be documented in this file. ## 9.0.2 -* Release instead of pre-release +* Remove unused properties in the `QuillToolbarSelectHeaderStyleDropdownButton` +* Fix the `QuillSimpleToolbar` when `useMaterial3` is false, please upgrade to the latest version of flutter for better support ## 9.0.2-dev.3 * Export `QuillSingleChildScrollView` diff --git a/lib/src/widgets/toolbar/buttons/font_family_button.dart b/lib/src/widgets/toolbar/buttons/font_family_button.dart index 17c87fb9..42c5ca6b 100644 --- a/lib/src/widgets/toolbar/buttons/font_family_button.dart +++ b/lib/src/widgets/toolbar/buttons/font_family_button.dart @@ -183,19 +183,30 @@ class QuillToolbarFontFamilyButtonState } return Tooltip(message: effectiveTooltip, child: child); }, - child: IconButton( - // tooltip: '', // TODO: Use this here - visualDensity: VisualDensity.compact, - style: IconButton.styleFrom( - shape: iconTheme?.borderRadius != null - ? RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(iconTheme?.borderRadius ?? -1), - ) - : null, - ), - onPressed: _onPressed, - icon: _buildContent(context), + child: Builder( + builder: (context) { + final isMaterial3 = Theme.of(context).useMaterial3; + if (!isMaterial3) { + return RawMaterialButton( + onPressed: _onPressed, + child: _buildContent(context), + ); + } + return IconButton( + // tooltip: , // TODO: Use this here + visualDensity: VisualDensity.compact, + style: IconButton.styleFrom( + shape: iconTheme?.borderRadius != null + ? RoundedRectangleBorder( + borderRadius: BorderRadius.circular( + iconTheme?.borderRadius ?? -1), + ) + : null, + ), + onPressed: _onPressed, + icon: _buildContent(context), + ); + }, ), ), ); diff --git a/lib/src/widgets/toolbar/buttons/font_size_button.dart b/lib/src/widgets/toolbar/buttons/font_size_button.dart index aa2c94ad..5dc41c38 100644 --- a/lib/src/widgets/toolbar/buttons/font_size_button.dart +++ b/lib/src/widgets/toolbar/buttons/font_size_button.dart @@ -142,21 +142,30 @@ class QuillToolbarFontSizeButtonState height: iconSize * 1.81, width: options.width, ), - child: UtilityWidgets.maybeTooltip( - message: tooltip, - child: IconButton( - visualDensity: VisualDensity.compact, - style: IconButton.styleFrom( - shape: iconTheme?.borderRadius != null - ? RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(iconTheme?.borderRadius ?? -1), - ) - : null, - ), - onPressed: _onPressed, - icon: _buildContent(context), - ), + child: Builder( + builder: (context) { + final isMaterial3 = Theme.of(context).useMaterial3; + if (!isMaterial3) { + return RawMaterialButton( + onPressed: _onPressed, + child: _buildContent(context), + ); + } + return IconButton( + tooltip: tooltip, + visualDensity: VisualDensity.compact, + style: IconButton.styleFrom( + shape: iconTheme?.borderRadius != null + ? RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(iconTheme?.borderRadius ?? -1), + ) + : null, + ), + onPressed: _onPressed, + icon: _buildContent(context), + ); + }, ), ); } diff --git a/lib/src/widgets/toolbar/buttons/hearder_style/select_header_style_dropdown_button.dart b/lib/src/widgets/toolbar/buttons/hearder_style/select_header_style_dropdown_button.dart index 698c42a9..fdfad12e 100644 --- a/lib/src/widgets/toolbar/buttons/hearder_style/select_header_style_dropdown_button.dart +++ b/lib/src/widgets/toolbar/buttons/hearder_style/select_header_style_dropdown_button.dart @@ -26,7 +26,7 @@ class _QuillToolbarSelectHeaderStyleDropdownButtonState extends State { Attribute _selectedItem = Attribute.header; - final _controller = MenuController(); + final _menuController = MenuController(); @override void initState() { super.initState(); @@ -158,7 +158,7 @@ class _QuillToolbarSelectHeaderStyleDropdownButtonState } return MenuAnchor( - controller: _controller, + controller: _menuController, menuChildren: headerAttributes .map( (e) => MenuItemButton( @@ -169,31 +169,45 @@ class _QuillToolbarSelectHeaderStyleDropdownButtonState ), ) .toList(), - child: IconButton( - onPressed: () { - if (_controller.isOpen) { - _controller.close(); - return; + child: Builder( + builder: (context) { + final isMaterial3 = Theme.of(context).useMaterial3; + final child = Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + _label(_selectedItem), + style: widget.options.textStyle ?? + TextStyle( + fontSize: iconSize / 1.15, + ), + ), + Icon( + Icons.arrow_drop_down, + size: iconSize * iconButtonFactor, + ), + ], + ); + if (!isMaterial3) { + return RawMaterialButton( + onPressed: _onDropdownButtonPressed, + child: child, + ); } - _controller.open(); + return IconButton( + onPressed: _onDropdownButtonPressed, + icon: child, + ); }, - icon: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - _label(_selectedItem), - style: widget.options.textStyle ?? - TextStyle( - fontSize: iconSize / 1.15, - ), - ), - Icon( - Icons.arrow_drop_down, - size: iconSize * iconButtonFactor, - ), - ], - ), ), ); } + + void _onDropdownButtonPressed() { + if (_menuController.isOpen) { + _menuController.close(); + return; + } + _menuController.open(); + } } diff --git a/quill_html_converter/CHANGELOG.md b/quill_html_converter/CHANGELOG.md index cb368a9b..fcd4ebd5 100644 --- a/quill_html_converter/CHANGELOG.md +++ b/quill_html_converter/CHANGELOG.md @@ -3,7 +3,8 @@ All notable changes to this project will be documented in this file. ## 9.0.2 -* Release instead of pre-release +* Remove unused properties in the `QuillToolbarSelectHeaderStyleDropdownButton` +* Fix the `QuillSimpleToolbar` when `useMaterial3` is false, please upgrade to the latest version of flutter for better support ## 9.0.2-dev.3 * Export `QuillSingleChildScrollView`