From ae5b91798fc88e7362dea9a2c6c5757229ba32e7 Mon Sep 17 00:00:00 2001 From: Treiol <59173175+Treiol@users.noreply.github.com> Date: Tue, 8 Nov 2022 12:03:37 +0300 Subject: [PATCH] Update dropdown.dart I did some modifications in DropdownFormField class: - made searchTextStyle field usable; - added searchCursorColor field. --- lib/src/dropdown.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/src/dropdown.dart b/lib/src/dropdown.dart index a2499e1..108b519 100644 --- a/lib/src/dropdown.dart +++ b/lib/src/dropdown.dart @@ -63,7 +63,10 @@ class DropdownFormField extends StatefulWidget { /// height of the dropdown overlay, Default: 240 final double? dropdownHeight; - /// Style the search box text + /// Cursor color of the search box text + final Color? searchCursorColor; + + /// Style of the search box text final TextStyle? searchTextStyle; /// Message to disloay if the search dows not match with any item, Default : "No matching found!" @@ -89,6 +92,7 @@ class DropdownFormField extends StatefulWidget { this.onChanged, this.onSaved, this.dropdownHeight, + this.searchCursorColor, this.searchTextStyle, this.emptyText = "No matching found!", this.emptyActionText = 'Create new', @@ -198,9 +202,9 @@ class DropdownFormFieldState extends State isFocused: _isFocused, child: this._overlayEntry != null ? EditableText( - style: TextStyle(fontSize: 16, color: Colors.black87), + style: widget.searchTextStyle ?? TextStyle(fontSize: 16, color: Colors.black87), controller: _searchTextController, - cursorColor: Colors.black87, + cursorColor: widget.searchCursorColor ?? Colors.black87, focusNode: _searchFocusNode, backgroundCursorColor: Colors.transparent, onChanged: (str) {