Skip to content

Commit ad8f3cc

Browse files
authored
Merge pull request #23 from deepikahr/appbar
Appbar
2 parents 8c626ba + 97bafa2 commit ad8f3cc

File tree

7 files changed

+1945
-97
lines changed

7 files changed

+1945
-97
lines changed

example/lib/main.dart

Lines changed: 191 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import 'package:ui_kit/components/card/gf_card.dart';
1010
import 'package:ui_kit/components/list_tile/gf_list_tile.dart';
1111
import 'package:ui_kit/components/image/gf_image_overlay.dart';
1212
import 'package:ui_kit/components/button_bar/gf_button_bar.dart';
13+
import 'package:ui_kit/components/segment_tabs/gf_segment_tabs.dart';
1314
import 'package:ui_kit/types/gf_type.dart';
1415
import 'package:ui_kit/shape/gf_avatar_shape.dart';
1516
import 'package:ui_kit/shape/gf_button_shape.dart';
@@ -22,6 +23,9 @@ import 'package:ui_kit/components/tabs/gf_tabs.dart';
2223
import 'package:ui_kit/components/slider/gf_items_slider.dart';
2324
import 'package:ui_kit/components/drawer/gf_drawer.dart';
2425
import 'package:ui_kit/components/drawer/gf_drawer_header.dart';
26+
import 'package:ui_kit/components/toast/gf_toast.dart';
27+
import 'package:ui_kit/components/appbar/gf_appbar.dart';
28+
import 'package:ui_kit/components/tabs/gf_tabBarView.dart';
2529

2630
final List<String> imageList = [
2731
"https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg",
@@ -57,8 +61,23 @@ class MyHomePage extends StatefulWidget {
5761
_MyHomePageState createState() => _MyHomePageState();
5862
}
5963

60-
class _MyHomePageState extends State<MyHomePage> {
64+
class _MyHomePageState extends State<MyHomePage> with SingleTickerProviderStateMixin {
65+
TabController tabController;
66+
67+
@override
68+
void initState() {
69+
super.initState();
70+
tabController = TabController(length: 3, vsync: this);
71+
}
72+
73+
@override
74+
void dispose() {
75+
tabController.dispose();
76+
super.dispose();
77+
}
78+
6179
bool switchValue = true;
80+
6281
@override
6382
Widget build(BuildContext context) {
6483
return Scaffold(
@@ -120,11 +139,42 @@ class _MyHomePageState extends State<MyHomePage> {
120139
],
121140
),
122141
),
123-
backgroundColor: Colors.cyanAccent,
124-
appBar: AppBar(
125-
title: Text(widget.title),
142+
appBar: GFAppBar(
143+
// backgroundColor: Colors.tealAccent,
144+
centerTitle: true,
145+
title: GFSegmentTabs(
146+
initialIndex: 0,
147+
length: 3,
148+
tabs: <Widget>[
149+
Tab(
150+
child: Text(
151+
"Gelatin",
152+
),
153+
),
154+
Tab(
155+
child: Text(
156+
"Donuts",
157+
),
158+
),
159+
Tab(
160+
child: Text(
161+
"Pastry",
162+
),
163+
),
164+
],
165+
),
166+
// trailing: <Widget>[
167+
// GFIconButton(icon: Icon(Icons.directions_bus), onPressed: null)
168+
// ],
126169
),
127-
body: SingleChildScrollView(
170+
backgroundColor: Colors.teal,
171+
body:
172+
// GFTabBarView(controller: tabController, children: <Widget>[
173+
// Container(color: Colors.red),
174+
// Container(color: Colors.green),
175+
// Container(color: Colors.blue)
176+
// ]),
177+
SingleChildScrollView(
128178
child: Column(
129179
mainAxisAlignment: MainAxisAlignment.center,
130180
crossAxisAlignment: CrossAxisAlignment.center,
@@ -134,6 +184,44 @@ class _MyHomePageState extends State<MyHomePage> {
134184
backgroundImage: NetworkImage("https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"),
135185
),
136186

187+
GFSegmentTabs(
188+
// height: 38.0,
189+
// width: 180.0,
190+
initialIndex: 0,
191+
length: 3,
192+
tabs: <Widget>[
193+
Tab(
194+
child: Text(
195+
"Gelatin",
196+
),
197+
),
198+
Tab(
199+
child: Text(
200+
"Donuts",
201+
),
202+
),
203+
Tab(
204+
child: Text(
205+
"Pastry",
206+
),
207+
),
208+
],
209+
// tabBarColor: Colors.pink.withOpacity(0.6),
210+
// indicatorSize: TabBarIndicatorSize.tab,
211+
// indicatorColor: Colors.tealAccent,
212+
// indicator: BoxDecoration(
213+
// color: Colors.pink,
214+
// border: Border.all(color: Colors.green, width: 1.0),
215+
// borderRadius: BorderRadius.circular(50.0)
216+
// ),
217+
// indicatorPadding: EdgeInsets.all(8.0),
218+
// indicatorWeight: 2.0,
219+
// border: Border.all(color: Colors.orange, width: 2.0),
220+
// borderRadius: BorderRadius.circular(50.0)
221+
),
222+
223+
224+
137225
// GFItemsSlider(
138226
// rowCount: 3,
139227
// children: imageList.map(
@@ -202,73 +290,84 @@ class _MyHomePageState extends State<MyHomePage> {
202290
// ),
203291
),
204292

205-
// GFTabs(
206-
// initialIndex: 0,
207-
// length: 3,
208-
// tabs: <Widget>[
209-
// GFButton(
210-
// onPressed: null,
211-
// child: Text("share"),
212-
// icon: Icon(Icons.share),
213-
// buttonBoxShadow: true,
214-
// ),
215-
// Tab(
216-
// icon: Icon(Icons.error),
217-
// child: Text(
218-
// "Orders",
219-
// ),
220-
// ),
221-
// Tab(
222-
// child: Text(
223-
// "Pastry",
224-
// ),
225-
// ),
226-
// ],
227-
// tabBarView: TabBarView(
228-
// children: <Widget>[
229-
// Container(
230-
// color: Colors.red,
231-
// child: Column(
232-
// mainAxisAlignment: MainAxisAlignment.center,
233-
// crossAxisAlignment: CrossAxisAlignment.center,
234-
// children: <Widget>[
235-
// RawMaterialButton(
236-
// onPressed: null,
237-
// child: Text("fv"),
238-
// ),
239-
// FlatButton(onPressed: null, child: Text("cds")),
240-
// Icon(Icons.directions_railway),
241-
// GFButton(
242-
// onPressed: null,
243-
// child: Text("share"),
244-
// icon: Icon(Icons.share),
245-
// shape: GFButtonShape.pills,
246-
// type: GFType.transparent,
247-
// ),
248-
// ],
249-
// ),
250-
// ),
251-
// Icon(Icons.directions_car),
252-
// Icon(Icons.directions_transit),
253-
// ],
254-
// ),
255-
// indicatorColor: Colors.teal,
256-
// indicatorSize: TabBarIndicatorSize.label,
257-
// labelColor: Colors.lightGreen,
258-
// unselectedLabelColor: Colors.black,
259-
// labelStyle: TextStyle(
260-
// fontWeight: FontWeight.w500,
261-
// fontSize: 13.0,
262-
// color: Colors.deepOrange,
263-
// fontFamily: 'OpenSansBold',
264-
// ),
265-
// unselectedLabelStyle: TextStyle(
266-
// fontWeight: FontWeight.w500,
267-
// fontSize: 13.0,
268-
// color: Colors.black,
269-
// fontFamily: 'OpenSansBold',
270-
// ),
293+
GFTabs(
294+
initialIndex: 0,
295+
length: 3,
296+
tabs: <Widget>[
297+
GFButton(
298+
onPressed: null,
299+
child: Text("share"),
300+
icon: Icon(Icons.share),
301+
buttonBoxShadow: true,
302+
),
303+
Tab(
304+
icon: Icon(Icons.error),
305+
child: Text(
306+
"Orders",
307+
),
308+
),
309+
Tab(
310+
child: Text(
311+
"Pastry",
312+
),
313+
),
314+
],
315+
tabBarView: GFTabBarView(
316+
children: <Widget>[
317+
Container(
318+
color: Colors.red,
319+
child: Column(
320+
mainAxisAlignment: MainAxisAlignment.center,
321+
crossAxisAlignment: CrossAxisAlignment.center,
322+
children: <Widget>[
323+
324+
GFToast(
325+
child: Text("sdc"),
326+
backgroundColor: Colors.pink,
327+
button: GFButton(
328+
text: 'dsx',
329+
onPressed: (){
330+
print("fdsc");
331+
},
332+
),
333+
),
334+
RawMaterialButton(
335+
onPressed: null,
336+
child: Text("fv"),
337+
),
338+
FlatButton(onPressed: null, child: Text("cds")),
339+
Icon(Icons.directions_railway),
340+
GFButton(
341+
onPressed: null,
342+
child: Text("share"),
343+
icon: Icon(Icons.share),
344+
shape: GFButtonShape.pills,
345+
type: GFType.transparent,
346+
),
347+
],
348+
),
349+
),
350+
Icon(Icons.directions_car),
351+
Icon(Icons.directions_transit),
352+
],
353+
),
354+
indicatorColor: Colors.teal,
355+
// indicatorSize: TabBarIndicatorSize.label,
356+
// labelColor: Colors.lightGreen,
357+
// unselectedLabelColor: Colors.black,
358+
// labelStyle: TextStyle(
359+
// fontWeight: FontWeight.w500,
360+
// fontSize: 13.0,
361+
// color: Colors.deepOrange,
362+
// fontFamily: 'OpenSansBold',
363+
// ),
364+
// unselectedLabelStyle: TextStyle(
365+
// fontWeight: FontWeight.w500,
366+
// fontSize: 13.0,
367+
// color: Colors.black,
368+
// fontFamily: 'OpenSansBold',
271369
// ),
370+
),
272371
//
273372
// GFSlider(
274373
// autoPlay: true,
@@ -459,30 +558,30 @@ class _MyHomePageState extends State<MyHomePage> {
459558
////
460559
//// borderRadius: BorderRadius.circular(20.0),
461560
// ),
462-
// GFIconBadges(
463-
// onPressed: null,
464-
// child: GFIconButton(
465-
// onPressed: null,
466-
// icon: Icon(Icons.ac_unit),
467-
// ),
468-
// counterChild: GFBadge(
469-
// text: '12',
470-
//
471-
//// color: GFColor.dark,
472-
////
561+
GFIconBadges(
562+
onPressed: null,
563+
child: GFIconButton(
564+
onPressed: null,
565+
icon: Icon(Icons.ac_unit),
566+
),
567+
counterChild: GFBadge(
568+
text: '12',
569+
570+
// color: GFColor.dark
571+
////,
473572
// shape: GFBadgeShape.circle,
474573
//
475574
// size: GFSize.small,
476-
////
477-
//// border: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
478-
////
479-
//// textColor: GFColor.white,
480-
////
481-
//// textStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 8.0),
482-
////
483-
//// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.orange, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero),
484-
// ),
485-
// ),
575+
//
576+
// border: BorderSide(color: Colors.pink, width: 1.0, style: BorderStyle.solid),
577+
//
578+
// textColor: GFColor.white,
579+
//
580+
// textStyle: TextStyle(fontWeight: FontWeight.w500, fontSize: 8.0),
581+
//
582+
// borderShape: RoundedRectangleBorder(side: BorderSide(color: Colors.orange, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.zero),
583+
),
584+
),
486585
// GFIconButton(
487586
// onPressed: null,
488587
// icon: Icon(Icons.ac_unit),

0 commit comments

Comments
 (0)