Skip to content

Commit

Permalink
Prepare to release 9.0.2 (#1608)
Browse files Browse the repository at this point in the history
* Prepare to release 9.0.2
  • Loading branch information
EchoEllet authored Dec 16, 2023
1 parent 33e7c46 commit f508a06
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 116 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
3 changes: 2 additions & 1 deletion flutter_quill_extensions/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
3 changes: 2 additions & 1 deletion flutter_quill_test/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
import 'package:flutter/material.dart' show PopupMenuEntry;
import 'package:flutter/widgets.dart'
show
Color,
EdgeInsets,
EdgeInsetsGeometry,
IconData,
TextOverflow,
TextStyle,
ValueChanged,
VoidCallback;
show IconData, TextStyle, ValueChanged, VoidCallback;

import '../../../../widgets/toolbar/base_toolbar.dart';
import '../../../documents/attribute.dart';
Expand Down Expand Up @@ -38,31 +29,14 @@ class QuillToolbarSelectHeaderStyleDropdownButtonOptions
this.iconButtonFactor,
this.textStyle,
super.iconData,
this.fillColor,
this.hoverElevation = 1,
this.highlightElevation = 1,
this.onSelected,
this.attributes,
this.padding,
this.style,
this.width,
this.labelOverflow = TextOverflow.visible,
this.itemHeight,
this.itemPadding,
this.defaultItemColor,
this.renderItemTextStyle = false,
});

/// By default we will the toolbar axis from [QuillSimpleToolbarConfigurations]
final double? iconSize;
final double? iconButtonFactor;
final TextStyle? textStyle;

final Color? fillColor;
final double hoverElevation;
final double highlightElevation;
final ValueChanged<String>? onSelected;

/// Header attributes, defaults to:
/// ```dart
/// [
Expand All @@ -76,59 +50,26 @@ class QuillToolbarSelectHeaderStyleDropdownButtonOptions
/// ]
/// ```
final List<Attribute<int>>? attributes;
final EdgeInsetsGeometry? padding;
final TextStyle? style;
final double? width;
final TextOverflow labelOverflow;
final double? itemHeight;
final EdgeInsets? itemPadding;
final Color? defaultItemColor;
final bool renderItemTextStyle;

QuillToolbarSelectHeaderStyleDropdownButtonOptions copyWith({
Color? fillColor,
double? hoverElevation,
double? highlightElevation,
List<PopupMenuEntry<String>>? items,
ValueChanged<String>? onSelected,
List<Attribute<int>>? attributes,
EdgeInsetsGeometry? padding,
TextStyle? style,
double? width,
TextOverflow? labelOverflow,
bool? renderFontFamilies,
bool? overrideTooltipByFontFamily,
double? itemHeight,
EdgeInsets? itemPadding,
Color? defaultItemColor,
double? iconSize,
double? iconButtonFactor,
IconData? iconData,
VoidCallback? afterButtonPressed,
String? tooltip,
QuillIconTheme? iconTheme,
bool? renderItemTextStyle,
}) {
return QuillToolbarSelectHeaderStyleDropdownButtonOptions(
attributes: attributes ?? this.attributes,
iconData: iconData ?? this.iconData,
afterButtonPressed: afterButtonPressed ?? this.afterButtonPressed,
tooltip: tooltip ?? this.tooltip,
iconTheme: iconTheme ?? this.iconTheme,
onSelected: onSelected ?? this.onSelected,
padding: padding ?? this.padding,
style: style ?? this.style,
width: width ?? this.width,
labelOverflow: labelOverflow ?? this.labelOverflow,
itemHeight: itemHeight ?? this.itemHeight,
itemPadding: itemPadding ?? this.itemPadding,
defaultItemColor: defaultItemColor ?? this.defaultItemColor,
iconSize: iconSize ?? this.iconSize,
iconButtonFactor: iconButtonFactor ?? this.iconButtonFactor,
fillColor: fillColor ?? this.fillColor,
hoverElevation: hoverElevation ?? this.hoverElevation,
highlightElevation: highlightElevation ?? this.highlightElevation,
renderItemTextStyle: renderItemTextStyle ?? this.renderItemTextStyle,
);
}
}
37 changes: 24 additions & 13 deletions lib/src/widgets/toolbar/buttons/font_family_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
},
),
),
);
Expand Down
39 changes: 24 additions & 15 deletions lib/src/widgets/toolbar/buttons/font_size_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
},
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class _QuillToolbarSelectHeaderStyleDropdownButtonState
extends State<QuillToolbarSelectHeaderStyleDropdownButton> {
Attribute<dynamic> _selectedItem = Attribute.header;

final _controller = MenuController();
final _menuController = MenuController();
@override
void initState() {
super.initState();
Expand Down Expand Up @@ -158,7 +158,7 @@ class _QuillToolbarSelectHeaderStyleDropdownButtonState
}

return MenuAnchor(
controller: _controller,
controller: _menuController,
menuChildren: headerAttributes
.map(
(e) => MenuItemButton(
Expand All @@ -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();
}
}
3 changes: 2 additions & 1 deletion quill_html_converter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit f508a06

Please sign in to comment.