Skip to content

Commit f171fe7

Browse files
committed
drawer header definations added
1 parent cc922d6 commit f171fe7

File tree

2 files changed

+96
-84
lines changed

2 files changed

+96
-84
lines changed

example/lib/main.dart

Lines changed: 91 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -139,29 +139,35 @@ class _MyHomePageState extends State<MyHomePage>
139139
// centerTitle: true,
140140
// leading: GFIconButton(icon: Icon(Icons.directions_bus), onPressed: (){}),
141141
title:
142-
// const Text('UI Kit'),
143-
GFSegmentTabs(
144-
tabController: tabController,
145-
initialIndex: 0,
146-
length: 3,
147-
tabs: const <Widget>[
148-
Text(
149-
'Tab1',
150-
),
151-
Text(
152-
'Tab2',
153-
),
154-
Text(
155-
'Tab3',
156-
),
157-
],
158-
),
142+
const Text('UI Kit'),
143+
// GFSegmentTabs(
144+
// tabController: tabController,
145+
// initialIndex: 0,
146+
// length: 3,
147+
// tabs: const <Widget>[
148+
// Text(
149+
// 'Tab1',
150+
// ),
151+
// Text(
152+
// 'Tab2',
153+
// ),
154+
// Text(
155+
// 'Tab3',
156+
// ),
157+
// ],
158+
// ),
159159
// bottom: TabBar(
160160
// controller: tabController,
161-
// tabs: [
162-
// Tab(icon: Icon(Icons.directions_car)),
163-
// Tab(icon: Icon(Icons.directions_transit)),
164-
// Tab(icon: Icon(Icons.directions_bike)),
161+
// tabs: const [
162+
// Text(
163+
// 'Tab1',
164+
// ),
165+
// Text(
166+
// 'Tab1',
167+
// ),
168+
// Text(
169+
// 'Tab1',
170+
// ),
165171
// ],
166172
// ),
167173
// searchBar: true,
@@ -804,22 +810,26 @@ class _MyHomePageState extends State<MyHomePage>
804810
// backgroundImage: NetworkImage("https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"),
805811
// ),
806812

807-
// GFSegmentTabs(
808-
// tabController: tabController,
809-
// initialIndex: 0,
810-
// length: 3,
811-
// tabs: <Widget>[
812-
// Text(
813-
// "Tab1",
814-
// ),
815-
// Text(
816-
// "Tab2",
817-
// ),
818-
// Text(
819-
// "Tab3",
820-
// ),
821-
// ],
822-
// ),
813+
GFSegmentTabs(
814+
tabController: tabController,
815+
initialIndex: 0,
816+
length: 3,
817+
tabs: const <Widget>[
818+
Text(
819+
'Tab1',
820+
),
821+
Text(
822+
'Tab2',
823+
),
824+
Text(
825+
'Tab3',
826+
),
827+
],
828+
indicatorColor: Colors.teal,
829+
border: Border.all(color: Colors.teal),
830+
unselectedLabelStyle: TextStyle(color: Colors.teal),
831+
labelStyle: TextStyle(color: Colors.teal),
832+
),
823833
//
824834
// GFTabBarView(controller: tabController, children: <Widget>[
825835
// Container(color: Colors.red),
@@ -1235,53 +1245,50 @@ class _MyHomePageState extends State<MyHomePage>
12351245
// ),
12361246
],
12371247
),
1238-
// ),
1239-
// bottomNavigationBar: GFTabBar(
1240-
// initialIndex: 0,
1241-
// length: 3,
1242-
// controller: tabController,
1243-
// tabs: [
1244-
// Tab(
1245-
// icon: Icon(Icons.directions_bike),
1246-
// child: Text(
1247-
// "Tab1",
1248-
// ),
1249-
// ),
1250-
// Tab(
1251-
// icon: Icon(Icons.directions_bus),
1252-
// child: Text(
1253-
// "Tab2",
1254-
// ),
1255-
// ),
1256-
// Tab(
1257-
// icon: Icon(Icons.directions_railway),
1258-
// child: Text(
1259-
// "Tab3",
1260-
// ),
1261-
// ),
1262-
// ],
1263-
// shape: RoundedRectangleBorder(
1264-
// borderRadius: BorderRadius.only(
1265-
// topLeft: Radius.circular(24.0),
1266-
// topRight: Radius.circular(24.0))),
1267-
// indicatorColor: Colors.white,
1268-
//// indicatorSize: TabBarIndicatorSize.label,
1269-
// labelColor: Colors.lightGreen,
1270-
// labelPadding: EdgeInsets.all(8.0),
1271-
// tabBarColor: Colors.blueGrey,
1272-
// unselectedLabelColor: Colors.black,
1273-
// labelStyle: TextStyle(
1274-
// fontWeight: FontWeight.w500,
1275-
// fontSize: 13.0,
1276-
// color: Colors.deepOrange,
1277-
// fontFamily: 'OpenSansBold',
1278-
// ),
1279-
// unselectedLabelStyle: TextStyle(
1280-
// fontWeight: FontWeight.w500,
1281-
// fontSize: 13.0,
1282-
// color: Colors.black,
1283-
// fontFamily: 'OpenSansBold',
1284-
// ),
1248+
),
1249+
bottomNavigationBar: GFTabBar(
1250+
initialIndex: 0,
1251+
length: 3,
1252+
controller: tabController,
1253+
tabs: const [
1254+
Text(
1255+
'Tab1',
1256+
),
1257+
Tab(
1258+
icon: Icon(Icons.directions_bus),
1259+
child: Text(
1260+
'Tab2',
1261+
),
1262+
),
1263+
Tab(
1264+
icon: Icon(Icons.directions_railway),
1265+
child: Text(
1266+
'Tab3',
1267+
),
1268+
),
1269+
],
1270+
shape: RoundedRectangleBorder(
1271+
borderRadius: BorderRadius.only(
1272+
topLeft: Radius.circular(24.0),
1273+
topRight: Radius.circular(24.0))),
1274+
// indicatorColor: Colors.white,
1275+
// indicatorSize: TabBarIndicatorSize.label,
1276+
// labelColor: Colors.lightGreen,
1277+
// labelPadding: EdgeInsets.all(8.0),
1278+
// tabBarColor: Colors.blueGrey,
1279+
// unselectedLabelColor: Colors.black,
1280+
labelStyle: TextStyle(
1281+
fontWeight: FontWeight.w500,
1282+
fontSize: 13.0,
1283+
color: Colors.deepOrange,
1284+
fontFamily: 'OpenSansBold',
1285+
),
1286+
unselectedLabelStyle: TextStyle(
1287+
fontWeight: FontWeight.w500,
1288+
fontSize: 13.0,
1289+
color: Colors.black,
1290+
fontFamily: 'OpenSansBold',
1291+
),
12851292
),
12861293
);
12871294
}

lib/components/drawer/gf_drawer_header.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ class GFDrawerHeaderPictures extends StatelessWidget {
1212
this.closeButton,
1313
}) : super(key: key);
1414

15+
/// A widget placed in the upper-left corner that represents the current
16+
/// user's account. Normally a [CircleAvatar].
1517
final Widget currentAccountPicture;
1618

19+
/// A list of widgets that represent the current user's other accounts.
20+
/// Up to three of these widgets will be arranged in a row in the header's
21+
/// upper-right corner. Normally a list of [CircleAvatar] widgets.
1722
final List<Widget> otherAccountsPictures;
1823

1924
/// widget onTap drawer get closed

0 commit comments

Comments
 (0)