搜尋套件、儲存庫與 APP 分類

GitHub 儲存庫anuj-patel-dev/searchbar_animation

searchbar_animation

anuj-patel-dev/searchbar_animation open-source repository details.

searchbar_animation 專案封面
星標
15
分支
4
最近推送(UTC)
2022年10月10日
專案狀態
未封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

Searchbar Animation

searchbar_animation


Searchbar Animation provides the horizontal slide animation to a searchbar and it is fully customizable.


Screenshots and Screen recording

Searchbar Animation


Searchbar Animation without Auto Keyboard Focus enableKeyboardFocus: false

Searchbar Animation


Searchbar Animation with Auto Keyboard Focus enableKeyboardFocus: true

Searchbar Animation

Usage

Installation

Add searchbar_animation: any to your pubspec.yaml dependencies. And import it:

import 'package:searchbar_animation/searchbar_animation.dart';
Example
SearchBarAnimation(
    textController: TextEditingController(),
    isOriginalAnimation: false,
    buttonBorderColour: Colors.black45,
    buttonIcon: Icons.search,
    onFieldSubmitted: (String value){
        debugPrint('onFieldSubmitted value $value');
    },
),

Parameters

Required Parameters
textEditingController:
  • Need to pass the textEditingController for the textFormField of searchbar.
isOriginalAnimation:
  • This is used to enable the button animation, default animation is based on 'DecoratedBoxTransition'. By default it is set to true. User can set it to false in order to disable the button animation and give the button shadow and border as per their requirement but if it is set to true than user cannot give shadow to the button when search box is in closed position.

Optional Parameters
searchBoxWidth:
  • SearchBoxWidth decides the width or the length of the search box by default it will take the full width of the screen.
trailingWidget:
  • TrailingWidget is use to set any widget which is at the end of the search box.
secondaryButtonWidget:
  • SecondaryButtonWidget is use to set any widget of button when the search box is open.
buttonWidget:
  • ButtonWidget is use to set any widget when the search box is closed.
hintText:
  • HintText helps to set the hint value for the search box for instance "Search Here.."
searchBoxColour:
  • SearchBoxColour helps to give the background colour of whole search box.
buttonColour:
  • ButtonColour is use to give the background colour to the button.
cursorColour:
  • CursorColour allows to give the colour to cursor of the textFormField of search box.
hintTextColour:
  • HintTextColour is use to give the colour to hintText of the textFormField in search box.
searchBoxBorderColour:
  • SearchBoxBorderColour allows us to give the colour to the border for search box.
buttonShadowColour:
  • ButtonShadowColour is use to give the colour to the shadow of button.
buttonBorderColour:
  • ButtonBorderColour is use to give the colour to the border of button.
durationInMilliSeconds:
  • DurationInMilliSeconds allow to set the animation duration of search box in terms of milliseconds.
textInputType:
  • TextInputType decides the input type in textFormField of search box for instance it can be type numeric.
isSearchBoxOnRightSide:
  • If user wants the button on the right side of the screen than can do the same by this property.
enableKeyboardFocus:
  • This is for Focusing or unFocusing the keyboard on the tap of search button. By enabling this it will automatically bring the keyboard on tap of the search box button otherwise it will bring the keyboard after tapping on to the searchField.
enableSearchBoxBorder:
  • If user want the border around the search box than it can be enable from this parameter.
enableButtonBorder:
  • If user want the border around the button than it can be enable from this parameter.
enableButtonShadow:
  • Can enable or disable the shadow of the button from here if isOriginalAnimation is set to false.
enableBoxShadow:
  • If user want the shadow under the search box than it can be enable from this parameter.
textAlignToRight:
  • In case of some languages like arabic if it is require to start from the right side than same can be done from this parameter.
onSaved:
  • This is the onSaved method of the textFormField, In order to use this user must wrap this widget into 'Form' widget.
onChanged:
  • This is the onChanged method of the textFormField.
onFieldSubmitted:
  • This is the onFieldSubmitted method of the textFormField.
onEditingComplete:
  • This is the onEditingComplete method of the textFormField.
onExpansionComplete:
  • onExpansionComplete functions can be used to perform something just after searchbox is opened.
onCollapseComplete:
  • onExpansionComplete functions can be used to perform something just after searchbox is closed.
onPressButton:
  • onPressButton function can be used to handle open/close searchbar button taps, it may be used for animation start handling.
enteredTextStyle:
  • This allows us to change the style of the text which user have entered in the textFormField of search box.
buttonElevation:
  • The elevation of the button can be set from this parameter.
inputFormatters:
  • InputFormatters helps us to set the RegExp to the textFormField od search box.

Guideline for contributors

Contribution towards our repository is always welcome, we request contributors to create a pull request to the development branch only.


Guideline to report an issue/feature request

  • It would be great for us if the reporter can share the below things to understand the root cause of the issue.
    • Library version
    • Code snippet
    • Logs if applicable
    • Device specification like (Manufacturer, OS version, etc)
    • Screenshot/video with steps to reproduce the issue

LICENSE

Searchbar Animation is MIT-licensed.

Anuj Patel GitHub avatar
GitHub 作者

Anuj Patel ↗

Senior Flutter Dev | Clean Architecture • Bloc • Riverpod | Cross-platform mobile & web | Clean Architecture • TDD/BDD | 5+ yrs shipping production apps

語言DartHTMLSwiftKotlinObjective-C

使用的依賴

依賴清單 3 項

  • flutter{"sdk":"flutter"}
  • flutter_test開發依賴{"sdk":"flutter"}
  • flutter_lints開發依賴^1.0.4

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗