Add `padding` and `style` to `QuillFontSizeButton`

pull/1179/head
BambinoUA 2 years ago
parent 8780c19080
commit b64e6783d7
  1. 15
      lib/src/widgets/toolbar/quill_font_size_button.dart

@ -22,6 +22,8 @@ class QuillFontSizeButton extends StatefulWidget {
this.iconTheme, this.iconTheme,
this.afterButtonPressed, this.afterButtonPressed,
this.tooltip, this.tooltip,
this.padding,
this.style,
Key? key, Key? key,
}) : super(key: key); }) : super(key: key);
@ -37,6 +39,8 @@ class QuillFontSizeButton extends StatefulWidget {
final QuillController controller; final QuillController controller;
final VoidCallback? afterButtonPressed; final VoidCallback? afterButtonPressed;
final String? tooltip; final String? tooltip;
final EdgeInsetsGeometry? padding;
final TextStyle? style;
@override @override
_QuillFontSizeButtonState createState() => _QuillFontSizeButtonState(); _QuillFontSizeButtonState createState() => _QuillFontSizeButtonState();
@ -150,15 +154,16 @@ class _QuillFontSizeButtonState extends State<QuillFontSizeButton> {
Widget _buildContent(BuildContext context) { Widget _buildContent(BuildContext context) {
final theme = Theme.of(context); final theme = Theme.of(context);
return Padding( return Padding(
padding: const EdgeInsets.fromLTRB(10, 0, 0, 0), padding: widget.padding ?? const EdgeInsets.fromLTRB(10, 0, 0, 0),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text(_currentValue, Text(_currentValue,
style: TextStyle( style: widget.style ??
fontSize: widget.iconSize / 1.15, TextStyle(
color: widget.iconTheme?.iconUnselectedColor ?? fontSize: widget.iconSize / 1.15,
theme.iconTheme.color)), color: widget.iconTheme?.iconUnselectedColor ??
theme.iconTheme.color)),
const SizedBox(width: 3), const SizedBox(width: 3),
Icon(Icons.arrow_drop_down, Icon(Icons.arrow_drop_down,
size: widget.iconSize / 1.15, size: widget.iconSize / 1.15,

Loading…
Cancel
Save