Skip to content

Commit 852600d

Browse files
fix:#23 (#24)
* feat: add textInputAction support * feat: add textInputAction support * feat: add parames to Readme.MD --------- Co-authored-by: hoollyzhang <[email protected]>
1 parent 75b7ed2 commit 852600d

File tree

6 files changed

+32
-20
lines changed

6 files changed

+32
-20
lines changed

README.md

+17-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Anim Search Bar
1+
# Anim Search Bar
22

33
[![Pub version](https://img.shields.io/pub/v/anim_search_bar)](https://pub.dev/packages/anim_search_bar) &nbsp; &nbsp; &nbsp; [![Codacy Badge](https://api.codacy.com/project/badge/Grade/5b71a1abd5354eecbe4a99fb298c81e2)](https://app.codacy.com/gh/Imgkl/anim_search_bar?utm_source=github.com&utm_medium=referral&utm_content=Imgkl/anim_search_bar&utm_campaign=Badge_Grade_Settings)
44
<br>
@@ -23,43 +23,47 @@
2323
<img src="https://i.ibb.co/k80JSS3/carbon.png">
2424

2525
## Parameters
26-
- width
26+
- width
2727
- Type: double
2828
- <b>Required</b>
29-
- textController
30-
- Type: TextEditingController
29+
- textController
30+
- Type: TextEditingController
3131
- <b>Required</b>
32-
- onSuffixTap
32+
- onSuffixTap
3333
- Type: Function
3434
- <b>Required</b>
35-
- rtl
35+
- rtl
3636
- Type: Boolean
3737
- <i>Optional</i>
3838
- Default: false
39-
- autoFocus
39+
- autoFocus
4040
- Type: Boolean
4141
- <i>Optional</i>
4242
- Default: false
43-
- closeOnSuffixTap
43+
- closeOnSuffixTap
4444
- Type: Boolean
4545
- <i>Optional</i>
4646
- Default: false
47-
- suffixIcon
47+
- suffixIcon
4848
- Type: Icon
4949
- <i>Optional</i>
5050
- Default: Icons.clear
51-
- prefixIcon
51+
- prefixIcon
5252
- Type: Icon
5353
- <i>Optional</i>
5454
- Default: Icons.search
55-
- animationDurationInMilli
56-
- Type: int
55+
- animationDurationInMilli
56+
- Type: int
5757
- <i>Optional</i>
5858
- Default: 375 milliseconds
59-
- helpText
59+
- helpText
6060
- Type: String
6161
- <i>Optional</i>
6262
- Default: Search...
63+
- textInputAction
64+
- Type: TextInputAction
65+
- <i>Optional</i>
66+
- Default: TextInputAction.done
6367

6468
### Stargazers
6569
[![Stargazers repo roster for @Imgkl/anim_search_bar](https://reporoster.com/stars/Imgkl/anim_search_bar)](https://github.com/Imgkl/anim_search_bar/stargazers)

example/main.dart

+5
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ class _AppState extends State<App> {
3939
textController.clear();
4040
});
4141
},
42+
rtl: true,
43+
onSubmitted: (String value) {
44+
debugPrint("onSubmitted value: " + value);
45+
},
46+
textInputAction: TextInputAction.search,
4247
),
4348
);
4449
}

example/pubspec.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ packages:
44
anim_search_bar:
55
dependency: "direct main"
66
description:
7-
name: anim_search_bar
8-
url: "https://pub.dartlang.org"
9-
source: hosted
10-
version: "0.0.1"
7+
path: ".."
8+
relative: true
9+
source: path
10+
version: "2.0.3"
1111
async:
1212
dependency: transitive
1313
description:

example/pubspec.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ dependencies:
1212
flutter:
1313
sdk: flutter
1414
anim_search_bar:
15-
16-
15+
path: ../
1716

1817
dev_dependencies:
1918
flutter_test:

lib/src/anim_search_widget.dart

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class AnimSearchBar extends StatefulWidget {
2020
/// textFieldColor - Color ,isRequired : No
2121
/// searchIconColor - Color ,isRequired : No
2222
/// textFieldIconColor - Color ,isRequired : No
23+
/// textInputAction -TextInputAction, isRequired : No
2324
2425
final double width;
2526
final double height;
@@ -40,6 +41,7 @@ class AnimSearchBar extends StatefulWidget {
4041
final List<TextInputFormatter>? inputFormatters;
4142
final bool boxShadow;
4243
final Function(String) onSubmitted;
44+
final TextInputAction textInputAction;
4345

4446
const AnimSearchBar({
4547
Key? key,
@@ -67,6 +69,7 @@ class AnimSearchBar extends StatefulWidget {
6769

6870
/// choose your custom color for the search when it is expanded
6971
this.textFieldIconColor = Colors.black,
72+
this.textInputAction = TextInputAction.done,
7073

7174
/// The onSuffixTap cannot be null
7275
required this.onSuffixTap,
@@ -255,6 +258,7 @@ class _AnimSearchBarState extends State<AnimSearchBar>
255258
controller: widget.textController,
256259
inputFormatters: widget.inputFormatters,
257260
focusNode: focusNode,
261+
textInputAction: widget.textInputAction,
258262
cursorRadius: Radius.circular(10.0),
259263
cursorWidth: 2.0,
260264
onChanged: (value) {

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: anim_search_bar
22
description: A flutter package that has an animated search bar with loads of customization
3-
version: 2.0.3
3+
version: 2.1.3
44
homepage: https://github.com/Imgkl/anim_search_bar
55
environment:
66
sdk: ">=2.12.0 <3.0.0"

0 commit comments

Comments
 (0)