SearchBarAnimation class
Constructors
SearchBarAnimation ({required TextEditingController textEditingController , required bool isOriginalAnimation , required Widget trailingWidget , required Widget secondaryButtonWidget , required Widget buttonWidget , double ? searchBoxWidth , String hintText = "Search Here" , Color ? searchBoxColour = AppColours.white , Color ? buttonColour = AppColours.white , Color ? cursorColour = AppColours.black , Color ? hintTextColour = AppColours.grey , Color ? searchBoxBorderColour = AppColours.black12 , Color ? buttonShadowColour = AppColours.black45 , Color ? buttonBorderColour = AppColours.black26 , int durationInMilliSeconds = Dimensions.t1000 , TextInputType textInputType = TextInputType.text , bool isSearchBoxOnRightSide = false , bool enableKeyboardFocus = false , bool enableBoxBorder = false , bool enableButtonBorder = false , bool enableButtonShadow = true , bool enableBoxShadow = true , bool textAlignToRight = false , Function ? onSaved , Function ? onChanged , Function ? onFieldSubmitted , Function ? onExpansionComplete , Function ? onCollapseComplete , dynamic onPressButton (bool isOpen )?, Function ? onEditingComplete , TextStyle ? enteredTextStyle , double buttonElevation = Dimensions.d0 , List <TextInputFormatter > ? inputFormatters , Key ? key })
const
Properties
buttonBorderColour
→ Color ?
User can set the border colour of button from here
final
buttonColour
→ Color ?
This property allows to set the background colour of the search button.
final
buttonElevation
→ double
This give the shadow to the search box button by default it is 0.
final
buttonShadowColour
→ Color ?
User can set the shadow colour of button form here.
final
buttonWidget
→ Widget
Provide the button icon that is when the search box is closed by default it is search icon.
final
cursorColour
→ Color ?
This allows to set the colour of the cursor of textFormField.
final
durationInMilliSeconds
→ int
Set the duration of animation from here by default it is 1000 milliseconds.
final
enableBoxBorder
→ bool
If user wants the border around the search box can enable from this parameter.
final
enableBoxShadow
→ bool
Can set if searchBox shadow is required from here.
final
enableButtonBorder
→ bool
If user wants border around the button they can set it from this parameter.
final
enableButtonShadow
→ bool
Can enable or disable the shadow of the button from here if isOriginalAnimation is set to false.
final
enableKeyboardFocus
→ bool
This property allows user to enable the keyboard on tap of search box button directly if this is set as true if not set as true than it will not automatically bring keyboard on tap of the search box button instead it will bring keyboard once searchField is tapped.
final
enteredTextStyle
→ TextStyle ?
This allows us to change the style of the text which user have entered in the textFormField of search box.
final
hashCode
→ int
The hash code for this object.
no setter inherited
hintText
→ String
Can Change the hint text from here.
final
hintTextColour
→ Color ?
This allows to set the hintText color of textFormField of the search box.
final
inputFormatters
→ List <TextInputFormatter > ?
Can set RegExp in the textFormField of search box from here.
final
isOriginalAnimation
→ bool
This is the required field it allows to enable or disable the animation of the button currently it's animation is based on the 'DecoratedBoxTransition', If it is disabled than user can give the shadow to the button but if it is set to true than cannot give shadow to the button when search box is closed.
final
isSearchBoxOnRightSide
→ bool
If user required the search box appear on the right side instead of left side they can set it from here.
final
key
→ Key ?
Controls how one widget replaces another widget in the tree.
final inherited
onChanged
→ Function ?
OnChanged function for the textFormField.
final
onCollapseComplete
→ Function ?
onCollapseComplete functions can be used to perform something just after searchbox is closed.
final
onEditingComplete
→ Function ?
onFieldSubmitted function for the textFormField.
final
onExpansionComplete
→ Function ?
onExpansionComplete functions can be used to perform something just after searchbox is opened.
final
onFieldSubmitted
→ Function ?
onFieldSubmitted function for the textFormField.
final
onPressButton
→ (dynamic Function(bool isOpen ) ?)
onPressButton function can be used to handle open/close searchbar button taps.
it may be used for animation start handling
final
onSaved
→ Function ?
OnSaved function for the textFormField, In order to use this user must wrap this widget into 'Form' widget.
final
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
searchBoxBorderColour
→ Color ?
If user required the search box border than they can set it's colour from here.
final
searchBoxColour
→ Color ?
This allows to set the background colour of the whole search box field by default it is set to white.
final
searchBoxWidth
→ double ?
This gives the width to the searchbar by default it will take the size of whole screen.
final
secondaryButtonWidget
→ Widget
Provide the button icon that is when the search box is open by default it is close icon.
final
textAlignToRight
→ bool
Can set the direction of the text, That is form right to left in case of languages like arabic.
final
textEditingController
→ TextEditingController
Need to pass the textEditingController for the textFormField of the searchbar.
final
textInputType
→ TextInputType
Can set keyBoard Type from here (e.g TextInputType.numeric) by default it is set to text,
final
trailingWidget
→ Widget
Provide trailing icon in search box which is at the end of search box by default it is search icon.
final
searchbar_animation 0.0.4