smartnsoft / flappy_search_bar

SearchBar widget to handle most of search cases
MIT License
172 stars 94 forks source link

Add shadow onto SearchBar #26

Open alexxcheung opened 4 years ago

alexxcheung commented 4 years ago

Is it possible to enhance the option of searchBarStyle? Because at the moment, it only enable people to change the background color, padding, border radius, which is not enough to have a better UI.

savadmv commented 4 years ago

Yes Just like this 👇 0

adschi commented 4 years ago

@savadmv how you did that?

jarrodmedrano commented 3 years ago

Flexible( child: Container( child: SearchBar<Asset>( onSearch: search, onCancelled: cancelSearch, shrinkWrap: true, hintText: "Asset Barcode", searchBarStyle: SearchBarStyle( backgroundColor: Colors.white, padding: EdgeInsets.all(10), borderRadius: BorderRadius.circular(2), ), onItemFound: (Asset asset, int index) { return ListTile( title: Text(asset.assetTypeName), subtitle: Text(asset.barcode), ); }), decoration: BoxDecoration( border: Border.all( width: 2.0, color: Colors.blue, style: BorderStyle.solid), boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.5), spreadRadius: 1, blurRadius: 1, offset: Offset.zero), ], ), ))

@savadmv how you did that?

I wrap it in a container and add a shadow to that.