Skip to content

Commit 97bafa2

Browse files
committed
gf segement tab error fixed
1 parent 723a689 commit 97bafa2

File tree

2 files changed

+64
-62
lines changed

2 files changed

+64
-62
lines changed

example/lib/main.dart

Lines changed: 61 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -81,66 +81,66 @@ class _MyHomePageState extends State<MyHomePage> with SingleTickerProviderStateM
8181
@override
8282
Widget build(BuildContext context) {
8383
return Scaffold(
84-
// drawer: GFDrawer(
85-
// colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.6), BlendMode.darken),
86-
// backgroundImage: NetworkImage("https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"),
87-
// gradient: LinearGradient(
88-
// begin: Alignment.topRight,
89-
// end: Alignment.bottomLeft,
90-
// stops: [0.1, 0.5, 0.7, 0.9],
91-
// colors: [
92-
// Colors.teal[800],
93-
// Colors.teal[600],
94-
// Colors.teal[400],
95-
// Colors.teal[200],
96-
// ],
97-
// ),
98-
// child: ListView(
99-
// padding: EdgeInsets.zero,
100-
// children: <Widget>[
101-
// GFDrawerHeader(
102-
// currentAccountPicture: GFAvatar(
103-
// radius: 80.0,
104-
// backgroundImage: NetworkImage("https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"),
105-
// ),
106-
//
107-
// decoration: BoxDecoration(
108-
// color: Colors.teal.withOpacity(0.45),
109-
// ),
110-
// otherAccountsPictures: <Widget>[
111-
// Image(
112-
// image: NetworkImage("https://cdn.pixabay.com/photo/2019/12/20/00/03/road-4707345_960_720.jpg"),
113-
// fit: BoxFit.cover,
114-
// ),
115-
// GFAvatar(
116-
// child: Text("dcf"),
117-
// )
118-
// ],
119-
// child: Column(
120-
// mainAxisAlignment: MainAxisAlignment.start,
121-
// crossAxisAlignment: CrossAxisAlignment.start,
122-
// children: <Widget>[
123-
// Text('user'),
124-
// Text('[email protected]'),
125-
// ],
126-
// ),
127-
// ),
128-
// ListTile(
129-
// title: Text('Item 1'),
130-
// onTap: () {
131-
// Navigator.pop(context);
132-
// },
133-
// ),
134-
// ListTile(
135-
// title: Text('Item 2'),
136-
// onTap: () {
137-
// },
138-
// ),
139-
// ],
140-
// ),
141-
// ),
84+
drawer: GFDrawer(
85+
colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.6), BlendMode.darken),
86+
backgroundImage: NetworkImage("https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"),
87+
gradient: LinearGradient(
88+
begin: Alignment.topRight,
89+
end: Alignment.bottomLeft,
90+
stops: [0.1, 0.5, 0.7, 0.9],
91+
colors: [
92+
Colors.teal[800],
93+
Colors.teal[600],
94+
Colors.teal[400],
95+
Colors.teal[200],
96+
],
97+
),
98+
child: ListView(
99+
padding: EdgeInsets.zero,
100+
children: <Widget>[
101+
GFDrawerHeader(
102+
currentAccountPicture: GFAvatar(
103+
radius: 80.0,
104+
backgroundImage: NetworkImage("https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"),
105+
),
106+
107+
decoration: BoxDecoration(
108+
color: Colors.teal.withOpacity(0.45),
109+
),
110+
otherAccountsPictures: <Widget>[
111+
Image(
112+
image: NetworkImage("https://cdn.pixabay.com/photo/2019/12/20/00/03/road-4707345_960_720.jpg"),
113+
fit: BoxFit.cover,
114+
),
115+
GFAvatar(
116+
child: Text("dcf"),
117+
)
118+
],
119+
child: Column(
120+
mainAxisAlignment: MainAxisAlignment.start,
121+
crossAxisAlignment: CrossAxisAlignment.start,
122+
children: <Widget>[
123+
Text('user'),
124+
125+
],
126+
),
127+
),
128+
ListTile(
129+
title: Text('Item 1'),
130+
onTap: () {
131+
Navigator.pop(context);
132+
},
133+
),
134+
ListTile(
135+
title: Text('Item 2'),
136+
onTap: () {
137+
},
138+
),
139+
],
140+
),
141+
),
142142
appBar: GFAppBar(
143-
backgroundColor: Colors.tealAccent,
143+
// backgroundColor: Colors.tealAccent,
144144
centerTitle: true,
145145
title: GFSegmentTabs(
146146
initialIndex: 0,
@@ -220,6 +220,8 @@ class _MyHomePageState extends State<MyHomePage> with SingleTickerProviderStateM
220220
// borderRadius: BorderRadius.circular(50.0)
221221
),
222222

223+
224+
223225
// GFItemsSlider(
224226
// rowCount: 3,
225227
// children: imageList.map(

lib/components/segment_tabs/gf_segment_tabs.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,12 @@ class _GFSegmentTabsState extends State<GFSegmentTabs> {
181181
unselectedLabelColor: widget.unselectedLabelColor,
182182
labelStyle: widget.labelStyle,
183183
unselectedLabelStyle: widget.unselectedLabelStyle,
184-
indicatorColor: widget.indicatorColor == null ? Theme.of(context).primaryColor : widget.indicatorColor,
184+
indicatorColor: widget.indicatorColor == null ? Colors.blueGrey : widget.indicatorColor,
185185
indicatorSize: widget.indicatorSize,
186186
indicator: widget.indicator == null ?
187187
BoxDecoration(
188-
color: widget.indicatorColor == null ? Theme.of(context).primaryColor : widget.indicatorColor,
189-
border: Border.all(color: widget.indicatorColor == null ? Theme.of(context).primaryColor : widget.indicatorColor, width: 2.0),
188+
color: widget.indicatorColor == null ? Colors.blueGrey : widget.indicatorColor,
189+
border: Border.all(color: widget.indicatorColor == null ? Colors.blueGrey : widget.indicatorColor, width: 2.0),
190190
borderRadius: widget.borderRadius == null ? BorderRadius.circular(6.0) : widget.borderRadius,
191191
) : widget.indicator,
192192
indicatorPadding: widget.indicatorPadding,

0 commit comments

Comments
 (0)