From f91ad4d4b1c52390fcb6295c9c6ae240f350c207 Mon Sep 17 00:00:00 2001 From: mark8044 <87546778+mark8044@users.noreply.github.com> Date: Fri, 6 May 2022 12:13:51 -0700 Subject: [PATCH] Update quill_dropdown_button.dart --- lib/src/widgets/toolbar/quill_dropdown_button.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/src/widgets/toolbar/quill_dropdown_button.dart b/lib/src/widgets/toolbar/quill_dropdown_button.dart index a136e244..8d79b65a 100644 --- a/lib/src/widgets/toolbar/quill_dropdown_button.dart +++ b/lib/src/widgets/toolbar/quill_dropdown_button.dart @@ -4,6 +4,7 @@ import '../../models/themes/quill_icon_theme.dart'; class QuillDropdownButton extends StatefulWidget { const QuillDropdownButton({ required this.initialValue, + required this.initialValueTitle, required this.items, required this.onSelected, this.height = 40, @@ -19,6 +20,7 @@ class QuillDropdownButton extends StatefulWidget { final double hoverElevation; final double highlightElevation; final T initialValue; + final String initialValueTitle; final List> items; final ValueChanged onSelected; final QuillIconTheme? iconTheme; @@ -29,12 +31,12 @@ class QuillDropdownButton extends StatefulWidget { // ignore: deprecated_member_use_from_same_package class _QuillDropdownButtonState extends State> { - int _currentValue = 0; + String _currentValue = ''; @override void initState() { super.initState(); - _currentValue = widget.initialValue as int; + _currentValue = widget.initialValueTitle; } @override @@ -87,7 +89,7 @@ class _QuillDropdownButtonState extends State> { return null; } setState(() { - _currentValue = newValue as int; + _currentValue = ((widget.items[1].key) as ValueKey).value; widget.onSelected(newValue); }); });