import 'package:flutter/material.dart'; buildFriendsHeader( BuildContext context, TextEditingController searchkey, Function filter) { return Container( height: 60.0, //margin: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0), child: Material( elevation: 4.0, borderRadius: BorderRadius.circular(12.0), shadowColor: Theme.of(context).backgroundColor, child: Row( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ //buildSmartSearch(context), new Expanded( child: InkWell( onTap: () => print("Searching"), child: TextField( autofocus: false, enabled: true, textAlign: TextAlign.start, controller: searchkey, onChanged: (String v) => filter(v), style: TextStyle( color: Theme.of(context).primaryColorLight, ), decoration: InputDecoration( border: InputBorder.none, //contentPadding: EdgeInsets.only(top: 14.0), prefixIcon: Icon( Icons.search, color: Theme.of(context).primaryColorLight, ), hintText: "Search", hintStyle: TextStyle(color: Colors.grey), ), ), ), ), ], ), ), ); }