Skip to content

Commit

Permalink
add the option to style the input (#9)
Browse files Browse the repository at this point in the history
* add the option to style the input

* update readme to include the new attribute
  • Loading branch information
Makosai authored Jan 24, 2022
1 parent 2af016d commit 555339f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ final TextInputAction keyboardAction;
///by default it's null
final InputDecoration? inputDecoration;

///the style for the input text field
/// by default it's null
final TextStyle? style;

///the keyboard text input type
///by default it's `TextInputType.text`
Expand Down
7 changes: 7 additions & 0 deletions lib/searchable_listview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class SearchableList<T> extends StatefulWidget {
this.searchTextController,
this.keyboardAction = TextInputAction.done,
this.inputDecoration,
this.style,
this.onSubmitSearch,
this.searchType = SEARCH_TYPE.onEdit,
this.emptyWidget = const SizedBox.shrink(),
Expand Down Expand Up @@ -55,6 +56,11 @@ class SearchableList<T> extends StatefulWidget {
///by default it's null
final InputDecoration? inputDecoration;
///the style for the input text field
///
/// by default it's null
final TextStyle? style;
///the keyboard text input type
///
///by default it's `TextInputType.text`
Expand Down Expand Up @@ -106,6 +112,7 @@ class _SearchableListState<T> extends State<SearchableList> {
textInputAction: widget.keyboardAction,
keyboardType: widget.textInputType,
obscureText: widget.obscureText,
style: widget.style,
onSubmitted: (value) {
widget.onSubmitSearch?.call(value);
if (widget.searchType == SEARCH_TYPE.onSubmit) {
Expand Down

0 comments on commit 555339f

Please sign in to comment.