Skip to content

Commit 40b4b6d

Browse files
committed
test cases for appbar added
1 parent 90a4c55 commit 40b4b6d

File tree

2 files changed

+483
-73
lines changed

2 files changed

+483
-73
lines changed

example/lib/main_temp.dart

Lines changed: 128 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class _MyHomePageState extends State<MyHomePage>
113113
// );
114114

115115
Scaffold(
116-
drawer: GFDrawer(
116+
// drawer: GFDrawer(
117117
// colorFilter: new ColorFilter.mode(
118118
// Colors.teal.withOpacity(0.6), BlendMode.DARKen),
119119
// backgroundImage: NetworkImage(
@@ -129,60 +129,82 @@ class _MyHomePageState extends State<MyHomePage>
129129
// Colors.teal[200],
130130
// ],
131131
// ),
132-
color: Colors.greenAccent,
133-
child: ListView(
134-
padding: EdgeInsets.zero,
135-
children: <Widget>[
136-
GFDrawerHeader(
137-
currentAccountPicture: const GFAvatar(
138-
radius: 80,
139-
backgroundImage: NetworkImage(
140-
'https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg'),
141-
),
142-
decoration: BoxDecoration(
143-
color: Colors.teal,
144-
),
145-
otherAccountsPictures: const <Widget>[
146-
Image(
147-
image: NetworkImage(
148-
'https://cdn.pixabay.com/photo/2019/12/20/00/03/road-4707345_960_720.jpg'),
149-
fit: BoxFit.cover,
150-
),
151-
GFAvatar(
152-
child: Text('dcf'),
153-
)
154-
],
155-
// closeButton: Text("Close"),
156-
child: Column(
157-
mainAxisAlignment: MainAxisAlignment.start,
158-
crossAxisAlignment: CrossAxisAlignment.start,
159-
children: const <Widget>[
160-
Text('user name'),
161-
162-
],
163-
),
164-
),
165-
const ListTile(
166-
title: Text('Item 1'),
167-
onTap: null,
168-
),
169-
const ListTile(
170-
title: Text('Item 2'),
171-
onTap: null,
172-
),
173-
],
174-
),
175-
),
132+
// color: Colors.greenAccent,
133+
// child: ListView(
134+
// padding: EdgeInsets.zero,
135+
// children: <Widget>[
136+
// GFDrawerHeader(
137+
// currentAccountPicture: const GFAvatar(
138+
// radius: 80,
139+
// backgroundImage: NetworkImage(
140+
// 'https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg'),
141+
// ),
142+
// decoration: BoxDecoration(
143+
// color: Colors.teal,
144+
// ),
145+
// otherAccountsPictures: const <Widget>[
146+
// Image(
147+
// image: NetworkImage(
148+
// 'https://cdn.pixabay.com/photo/2019/12/20/00/03/road-4707345_960_720.jpg'),
149+
// fit: BoxFit.cover,
150+
// ),
151+
// GFAvatar(
152+
// child: Text('dcf'),
153+
// )
154+
// ],
155+
// // closeButton: Text("Close"),
156+
// child: Column(
157+
// mainAxisAlignment: MainAxisAlignment.start,
158+
// crossAxisAlignment: CrossAxisAlignment.start,
159+
// children: const <Widget>[
160+
// Text('user name'),
161+
// Text('[email protected]'),
162+
// ],
163+
// ),
164+
// ),
165+
// const ListTile(
166+
// title: Text('Item 1'),
167+
// onTap: null,
168+
// ),
169+
// const ListTile(
170+
// title: Text('Item 2'),
171+
// onTap: null,
172+
// ),
173+
// ],
174+
// ),s
175+
// ),
176176

177177
appBar: GFAppBar(
178-
backgroundColor: Colors.teal,
179-
// centerTitle: true,
180-
// leading: GFIconButton(icon: Icon(Icons.directions_bus), onPressed: (){}),
181-
title: const Text('UI Kit'),
182-
// GFSegmentTabs(
178+
// toolbarOpacity: 0.5,
179+
// bottomOpacity: 0.6,
180+
// elevation: 1,
181+
// textTheme: const TextTheme(
182+
// headline5: TextStyle(color: Colors.tealAccent)
183+
// ),
184+
iconTheme: const IconThemeData(
185+
color: Colors.red
186+
),
187+
actionsIconTheme: const IconThemeData(
188+
color: Colors.amber
189+
),
190+
// brightness: Brightness.light,
191+
// primary: false,
192+
// titleSpacing: 5,
193+
// automaticallyImplyLeading: false,
194+
// backgroundColor: Colors.teal,
195+
// shape: RoundedRectangleBorder(
196+
// side: const BorderSide(color: Colors.tealAccent, width: 1, style: BorderStyle.solid),
197+
// borderRadius: BorderRadius.circular(25)),
198+
// centerTitle: true,
199+
leading: const Icon(
200+
Icons.wb_sunny,
201+
// color: GFColors.WHITE,
202+
),
203+
// flexibleSpace: Container(child: Text('vgfd'), color: Colors.red,),
204+
title: const Text('Appbar'),
205+
// title: GFSegmentTabs(
183206
// tabController: tabController,
184-
// initialIndex: 0,
185-
// length: 3,
207+
// length: 6,
186208
// tabs: const <Widget>[
187209
// Text(
188210
// 'Tab1',
@@ -193,19 +215,44 @@ class _MyHomePageState extends State<MyHomePage>
193215
// Text(
194216
// 'Tab3',
195217
// ),
218+
// Text(
219+
// 'Tab1',
220+
// ),
221+
// Text(
222+
// 'Tab2',
223+
// ),
224+
// Text(
225+
// 'Tab3',
226+
// ),
196227
// ],
197228
// ),
229+
bottom: PreferredSize(
230+
child: Container(
231+
color: Colors.orange,
232+
height: 4,
233+
),
234+
preferredSize: const Size.fromHeight(4)
235+
),
198236
// bottom: TabBar(
199237
// controller: tabController,
200238
// tabs: const [
239+
// Tab(
240+
// text: 'Tab1',
241+
// ),
201242
// Text(
202-
// 'Tab1',
243+
// 'Tab2',
203244
// ),
204245
// Text(
205-
// 'Tab1',
246+
// 'Tab3',
206247
// ),
207248
// Text(
208-
// 'Tab1',
249+
// 'Tab4',
250+
// ),
251+
// Text(
252+
// 'Tab5',
253+
// ),
254+
// Text(
255+
// 'Tab6',
209256
// ),
210257
// ],
211258
// labelStyle: TextStyle(
@@ -222,27 +269,35 @@ class _MyHomePageState extends State<MyHomePage>
222269
// ),
223270
// ),
224271
searchBar: true,
225-
//searchController: _searchController,
226-
onChanged: (val) {
227-
print('$val');
228-
setState(() {
229-
searchData = val;
230-
});
272+
searchController: _searchController,
273+
// onChanged: (value) {
274+
// setState(() {
275+
// searchData = value;
276+
// });
277+
// },
278+
searchHintText: 'Search',
279+
searchHintStyle: const TextStyle(fontSize: 14, color: Colors.white70),
280+
searchTextStyle: const TextStyle(fontSize: 16, color: Colors.white),
281+
searchBarColorTheme: Colors.white,
282+
onChanged: (value) {
283+
print('on change $value');
284+
},
285+
onSubmitted: (value) {
286+
print('submitted $value');
231287
},
232-
// searchHintText: "aaaaaaa",
233-
// searchHintStyle: TextStyle(fontSize: 18.0, color: Colors.redAccent),
234-
// searchStyle: TextStyle(fontSize: 10.0, color: Colors.green),
235-
// searchBarColorTheme: Colors.greenAccent,
236-
actions: <Widget>[
237-
// GFIconButton(icon: Icon(Icons.access_time), onPressed: () {}),
238-
GFIconButton(
239-
icon: Icon(
288+
onTap: () {
289+
print('tapped');
290+
},
291+
actions: const <Widget>[
292+
// GFIconButton(
293+
// icon:
294+
Icon(
240295
Icons.favorite,
241-
color: GFColors.WHITE,
296+
// color: GFColors.WHITE,
242297
),
243-
onPressed: () {},
244-
type: GFButtonType.transparent,
245-
),
298+
// onPressed: () {},
299+
// type: GFButtonType.transparent,
300+
// ),
246301
],
247302
),
248303
// backgroundColor: Colors.blueGrey,

0 commit comments

Comments
 (0)