@@ -59,7 +59,16 @@ class _MyHomePageState extends State<MyHomePage>
5959 Widget appBarTitle = new Text ("UI Kit" );
6060 Icon actionIcon = new Icon (Icons .search);
6161
62- List list = ["Flutter" , "Flutterjjk" , "Flutterhy" , "jhFlutter" ];
62+ List list = [
63+ "Flutter" ,
64+ "React" ,
65+ "Ionic" ,
66+ "Xamarin" ,
67+ "Flutter2" ,
68+ "React2" ,
69+ "Ionic2" ,
70+ "Xamarin2" ,
71+ ];
6372
6473 @override
6574 Widget build (BuildContext context) {
@@ -138,15 +147,22 @@ class _MyHomePageState extends State<MyHomePage>
138147// Tab(icon: Icon(Icons.directions_bike)),
139148// ],
140149// ),
141- // searchBar: true,
150+ searchBar: true ,
142151// searchHintText: "aaaaaaa",
143152// searchHintStyle: TextStyle(fontSize: 18.0, color: Colors.redAccent),
144153// searchStyle: TextStyle(fontSize: 10.0, color: Colors.green),
145154// searchBarColorTheme: Colors.greenAccent,
146155
147156 actions: < Widget > [
148- GFIconButton (icon: Icon (Icons .access_time), onPressed: () {}),
149- GFIconButton (icon: Icon (Icons .favorite), onPressed: null ),
157+ // GFIconButton(icon: Icon(Icons.access_time), onPressed: () {}),
158+ GFIconButton (
159+ icon: Icon (
160+ Icons .favorite,
161+ color: Colors .white,
162+ ),
163+ onPressed: () {},
164+ type: GFButtonType .transparent,
165+ ),
150166 ],
151167 ),
152168// backgroundColor: Colors.blueGrey,
@@ -164,66 +180,36 @@ class _MyHomePageState extends State<MyHomePage>
164180 mainAxisAlignment: MainAxisAlignment .center,
165181 crossAxisAlignment: CrossAxisAlignment .center,
166182 children: < Widget > [
167- GFIconButton (
168- icon: Icon (Icons .title),
169- onPressed: null ,
170- // color: GFColor.secondary,
183+ GFSearchBar (
184+ searchList: list,
185+ hideSearchBoxWhenItemSelected: false ,
186+ overlaySearchListHeight: 100.0 ,
187+ searchQueryBuilder: (query, list) {
188+ return list
189+ .where ((item) =>
190+ item.toLowerCase ().contains (query.toLowerCase ()))
191+ .toList ();
192+ },
193+ overlaySearchListItemBuilder: (item) {
194+ return Container (
195+ padding: const EdgeInsets .all (12 ),
196+ child: Text (
197+ item,
198+ style: const TextStyle (fontSize: 18 ),
199+ ),
200+ );
201+ },
202+ noItemsFoundWidget: Container (
203+ color: Colors .green,
204+ child: Text ("no items found" ),
205+ ),
206+ onItemSelected: (item) {
207+ setState (() {
208+ print ('ssssssss $item ' );
209+ });
210+ },
171211 ),
172212
173- // GFSearchBar(
174- // dataList: list,
175- // hideSearchBoxWhenItemSelected: false,
176- // listContainerHeight: MediaQuery.of(context).size.height / 4,
177- // queryBuilder: (query, list) {
178- // return list
179- // .where((item) => item.username
180- // .toLowerCase()
181- // .contains(query.toLowerCase()))
182- // .toList();
183- // },
184- // popupListItemBuilder: (item) {
185- // return item;
186- // },
187- //// selectedItemBuilder: (selectedItem, deleteSelectedItem) {
188- //// return SelectedItemWidget(selectedItem, deleteSelectedItem);
189- //// },
190- // // widget customization
191- // noItemsFoundWidget: Container(child: Text("fgv"),),
192- // textFieldBuilder: (controller, focusNode) {
193- // return Padding(
194- // padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
195- // child: TextField(
196- // controller: controller,
197- // focusNode: focusNode,
198- // style: TextStyle(fontSize: 16, color: Colors.grey[600]),
199- // decoration: InputDecoration(
200- // enabledBorder: const OutlineInputBorder(
201- // borderSide: BorderSide(
202- // color: Color(0x4437474F),
203- // ),
204- // ),
205- // focusedBorder: OutlineInputBorder(
206- // borderSide: BorderSide(color: Theme.of(context).primaryColor),
207- // ),
208- // suffixIcon: Icon(Icons.search),
209- // border: InputBorder.none,
210- // hintText: "Search here...",
211- // contentPadding: const EdgeInsets.only(
212- // left: 16,
213- // right: 20,
214- // top: 14,
215- // bottom: 14,
216- // ),
217- // ),
218- // ));
219- // },
220- // onItemSelected: (item) {
221- // setState(() {
222- //// _selectedItem = item;
223- // });
224- // },
225- // ),
226-
227213// GFCard(
228214// content: Column(
229215// children: <Widget>[
@@ -1162,49 +1148,53 @@ class _MyHomePageState extends State<MyHomePage>
11621148 ],
11631149 ),
11641150 ),
1165- // bottomNavigationBar: GFTabBar(
1166- // initialIndex: 0,
1167- // length: 3,
1168- // controller: tabController,
1169- // tabs: [
1170- // Tab(
1171- // icon: Icon(Icons.directions_bike),
1172- // child: Text(
1173- // "Tab1",
1174- // ),
1175- // ),
1176- // Tab(
1177- // icon: Icon(Icons.directions_bus),
1178- // child: Text(
1179- // "Tab2",
1180- // ),
1181- // ),
1182- // Tab(
1183- // icon: Icon(Icons.directions_railway),
1184- // child: Text(
1185- // "Tab3",
1186- // ),
1187- // ),
1188- // ],
1189- // indicatorColor: Colors.white,
1190- //// indicatorSize: TabBarIndicatorSize.label,
1191- // labelColor: Colors.lightGreen,
1192- // labelPadding: EdgeInsets.all(8.0),
1193- // tabBarColor: Colors.blueGrey,
1194- // unselectedLabelColor: Colors.black,
1195- // labelStyle: TextStyle(
1196- // fontWeight: FontWeight.w500,
1197- // fontSize: 13.0,
1198- // color: Colors.deepOrange,
1199- // fontFamily: 'OpenSansBold',
1200- // ),
1201- // unselectedLabelStyle: TextStyle(
1202- // fontWeight: FontWeight.w500,
1203- // fontSize: 13.0,
1204- // color: Colors.black,
1205- // fontFamily: 'OpenSansBold',
1206- // ),
1207- // ),
1151+ bottomNavigationBar: GFTabBar (
1152+ initialIndex: 0 ,
1153+ length: 3 ,
1154+ controller: tabController,
1155+ tabs: [
1156+ Tab (
1157+ icon: Icon (Icons .directions_bike),
1158+ child: Text (
1159+ "Tab1" ,
1160+ ),
1161+ ),
1162+ Tab (
1163+ icon: Icon (Icons .directions_bus),
1164+ child: Text (
1165+ "Tab2" ,
1166+ ),
1167+ ),
1168+ Tab (
1169+ icon: Icon (Icons .directions_railway),
1170+ child: Text (
1171+ "Tab3" ,
1172+ ),
1173+ ),
1174+ ],
1175+ shape: RoundedRectangleBorder (
1176+ borderRadius: BorderRadius .only (
1177+ topLeft: Radius .circular (24.0 ),
1178+ topRight: Radius .circular (24.0 ))),
1179+ indicatorColor: Colors .white,
1180+ // indicatorSize: TabBarIndicatorSize.label,
1181+ labelColor: Colors .lightGreen,
1182+ labelPadding: EdgeInsets .all (8.0 ),
1183+ tabBarColor: Colors .blueGrey,
1184+ unselectedLabelColor: Colors .black,
1185+ labelStyle: TextStyle (
1186+ fontWeight: FontWeight .w500,
1187+ fontSize: 13.0 ,
1188+ color: Colors .deepOrange,
1189+ fontFamily: 'OpenSansBold' ,
1190+ ),
1191+ unselectedLabelStyle: TextStyle (
1192+ fontWeight: FontWeight .w500,
1193+ fontSize: 13.0 ,
1194+ color: Colors .black,
1195+ fontFamily: 'OpenSansBold' ,
1196+ ),
1197+ ),
12081198 );
12091199 }
12101200}
0 commit comments