Upgrade to 4.1.5

pull/791/head
X Code 3 years ago
parent 7b330c95f0
commit 6ac59dcfbb
  1. 3
      CHANGELOG.md
  2. 50
      lib/src/widgets/toolbar.dart
  3. 7
      lib/src/widgets/toolbar/quill_dropdown_button.dart
  4. 2
      pubspec.yaml

@ -1,3 +1,6 @@
# [4.1.5]
* Add Font Size dropdown to the toolbar.
# [4.1.4] # [4.1.4]
* New borderRadius for iconTheme. * New borderRadius for iconTheme.

@ -113,7 +113,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
///List of font sizes in [int] ///List of font sizes in [int]
List? fontSizeValues, List? fontSizeValues,
int? initialFontSizeValue, int? initialFontSizeValue,
///The theme to use for the icons in the toolbar, uses type [QuillIconTheme] ///The theme to use for the icons in the toolbar, uses type [QuillIconTheme]
QuillIconTheme? iconTheme, QuillIconTheme? iconTheme,
@ -127,8 +127,8 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
Key? key, Key? key,
}) { }) {
final isButtonGroupShown = [ final isButtonGroupShown = [
showFontSize || showFontSize ||
showBoldButton || showBoldButton ||
showItalicButton || showItalicButton ||
showSmallButton || showSmallButton ||
showUnderLineButton || showUnderLineButton ||
@ -151,19 +151,9 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
]; ];
//default font size values //default font size values
final fontSizes = fontSizeValues ?? [ final fontSizes =
10, fontSizeValues ?? [10, 12, 14, 16, 18, 20, 24, 28, 32, 48];
12,
14,
16,
18,
20,
24,
28,
32,
48
];
return QuillToolbar( return QuillToolbar(
key: key, key: key,
toolbarHeight: toolbarIconSize * 2, toolbarHeight: toolbarIconSize * 2,
@ -189,24 +179,24 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
iconTheme: iconTheme, iconTheme: iconTheme,
), ),
if (showFontSize) if (showFontSize)
QuillDropdownButton( QuillDropdownButton(
iconTheme: iconTheme, iconTheme: iconTheme,
height:toolbarIconSize*2, height: toolbarIconSize * 2,
items:[ items: [
for (var fontSize in fontSizes) for (var fontSize in fontSizes)
PopupMenuItem<int>( PopupMenuItem<int>(
value: fontSize, value: fontSize,
child: Text(fontSize.toString()), child: Text(fontSize.toString()),
), ),
], ],
onSelected:(newSize){ onSelected: (newSize) {
if (newSize != null) if (newSize != null) {
{ controller
controller.formatSelection(Attribute.fromKeyValue('size', newSize)); .formatSelection(Attribute.fromKeyValue('size', newSize));
} }
}, },
initialValue: fontSizes[initialFontSizeValue ?? 0], initialValue: fontSizes[initialFontSizeValue ?? 0],
), ),
if (showBoldButton) if (showBoldButton)
ToggleStyleButton( ToggleStyleButton(
attribute: Attribute.bold, attribute: Attribute.bold,

@ -29,14 +29,13 @@ class QuillDropdownButton<T> extends StatefulWidget {
// ignore: deprecated_member_use_from_same_package // ignore: deprecated_member_use_from_same_package
class _QuillDropdownButtonState<T> extends State<QuillDropdownButton<T>> { class _QuillDropdownButtonState<T> extends State<QuillDropdownButton<T>> {
int _currentValue = 0; int _currentValue = 0;
@override @override
void initState(){ void initState() {
_currentValue = widget.initialValue as int; _currentValue = widget.initialValue as int;
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ConstrainedBox( return ConstrainedBox(

@ -1,6 +1,6 @@
name: flutter_quill name: flutter_quill
description: A rich text editor supporting mobile and web (Demo App @ bulletjournal.us) description: A rich text editor supporting mobile and web (Demo App @ bulletjournal.us)
version: 4.1.4 version: 4.1.5
#author: bulletjournal #author: bulletjournal
homepage: https://bulletjournal.us/home/index.html homepage: https://bulletjournal.us/home/index.html
repository: https://github.com/singerdmx/flutter-quill repository: https://github.com/singerdmx/flutter-quill

Loading…
Cancel
Save