Skip to content

Commit fcb8d00

Browse files
committed
drawer background color fixed
1 parent cddd97c commit fcb8d00

File tree

2 files changed

+27
-21
lines changed

2 files changed

+27
-21
lines changed

example/lib/main.dart

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,20 @@ class _MyHomePageState extends State<MyHomePage>
7676
drawer: GFDrawer(
7777
// colorFilter: new ColorFilter.mode(
7878
// Colors.pinkAccent.withOpacity(0.6), BlendMode.darken),
79-
backgroundImage: NetworkImage(
80-
"https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"),
81-
gradient: LinearGradient(
82-
begin: Alignment.topRight,
83-
end: Alignment.bottomLeft,
84-
stops: [0.1, 0.5, 0.7, 0.9],
85-
colors: [
86-
Colors.teal[800],
87-
Colors.teal[600],
88-
Colors.teal[400],
89-
Colors.teal[200],
90-
],
91-
),
79+
// backgroundImage: NetworkImage(
80+
// "https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"),
81+
// gradient: LinearGradient(
82+
// begin: Alignment.topRight,
83+
// end: Alignment.bottomLeft,
84+
// stops: [0.1, 0.5, 0.7, 0.9],
85+
// colors: [
86+
// Colors.teal[800],
87+
// Colors.teal[600],
88+
// Colors.teal[400],
89+
// Colors.teal[200],
90+
// ],
91+
// ),
92+
color: Colors.greenAccent,
9293
child: ListView(
9394
padding: EdgeInsets.zero,
9495
children: <Widget>[
@@ -99,7 +100,7 @@ class _MyHomePageState extends State<MyHomePage>
99100
"https://cdn.pixabay.com/photo/2017/12/03/18/04/christmas-balls-2995437_960_720.jpg"),
100101
),
101102
decoration: BoxDecoration(
102-
color: Colors.teal.withOpacity(0.45),
103+
color: Colors.teal,
103104
),
104105
otherAccountsPictures: <Widget>[
105106
Image(

lib/components/drawer/gf_drawer.dart

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@ class GFDrawer extends StatelessWidget {
5959
/// The [elevation] must be non-negative.
6060
const GFDrawer(
6161
{Key key,
62-
this.elevation = 16.0,
63-
this.child,
64-
this.semanticLabel,
65-
this.backgroundImage,
66-
this.colorFilter,
67-
this.gradient})
62+
this.elevation = 16.0,
63+
this.child,
64+
this.semanticLabel,
65+
this.backgroundImage,
66+
this.colorFilter,
67+
this.gradient,
68+
this.color,
69+
})
6870
: assert(elevation != null && elevation >= 0.0),
6971
super(key: key);
7072

@@ -105,6 +107,9 @@ class GFDrawer extends StatelessWidget {
105107
/// applying the same transform to the entire canvas.
106108
final Gradient gradient;
107109

110+
/// Defines the background color of the drawer
111+
final Color color;
112+
108113
@override
109114
Widget build(BuildContext context) {
110115
assert(debugCheckHasMaterialLocalizations(context));
@@ -131,7 +136,7 @@ class GFDrawer extends StatelessWidget {
131136
elevation: elevation,
132137
child: Container(
133138
decoration: new BoxDecoration(
134-
color: Colors.teal,
139+
color: color,
135140
gradient: gradient,
136141
image: backgroundImage != null
137142
? new DecorationImage(

0 commit comments

Comments
 (0)