@@ -117,8 +117,8 @@ const Duration _kBaseSettleDuration = Duration(milliseconds: 246);
117117/// shown.
118118/// * [Scaffold.of] , to obtain the current [ScaffoldState] , which manages the
119119/// display and animation of the drawer.
120- /// * [ScaffoldState.openGFDrawer] , which displays its [GFDrawer] , if any .
121- /// * <https://material.io/design/components/navigation-drawer.html>
120+ /// * [ScaffoldState.openGFDrawer] , which displays its [GFDrawer] .
121+ ///
122122class GFDrawer extends StatelessWidget {
123123 /// Creates a material design drawer.
124124 ///
@@ -130,6 +130,7 @@ class GFDrawer extends StatelessWidget {
130130 this .elevation = 16.0 ,
131131 this .child,
132132 this .semanticLabel,
133+ this .backgroundImage
133134 }) : assert (elevation != null && elevation >= 0.0 ),
134135 super (key: key);
135136
@@ -160,6 +161,8 @@ class GFDrawer extends StatelessWidget {
160161 /// value is used.
161162 final String semanticLabel;
162163
164+ final ImageProvider backgroundImage;
165+
163166 @override
164167 Widget build (BuildContext context) {
165168 assert (debugCheckHasMaterialLocalizations (context));
@@ -181,7 +184,17 @@ class GFDrawer extends StatelessWidget {
181184 constraints: const BoxConstraints .expand (width: _kWidth),
182185 child: Material (
183186 elevation: elevation,
184- child: child,
187+ child: Container (
188+ decoration: new BoxDecoration (
189+ image: new DecorationImage (
190+ image: backgroundImage,
191+ fit: BoxFit .cover,
192+ colorFilter: new ColorFilter .mode (
193+ Colors .black.withOpacity (0.65 ), BlendMode .darken),
194+ ),
195+ ),
196+ child: child
197+ ),
185198 ),
186199 ),
187200 );
0 commit comments