How do I make the Navigation Drawer of my Flutter app transparent?


Asked by Lebogang N on September 28, 2018 (source).

I have built a native Android App which has a transparent navigation drawer. I have been asked to build the same app using Flutter and I have gotten to the point where I would like to implement a transparent navigation drawer. How do I make the Navigation Drawer of my Flutter app transparent because I have been struggling on that end ? I have already tried

drawer: Drawer(
          child: Container(
            color: Colors.transparent,)),

The navigation drawer just remains white. I have been searching for a solution to this and cant find one. Any help would be appreciated. I have attached images of the Native App with a transparent drawer and the Flutter version with a white Navigation drawer




Question answered by iRedia E (source).

I think there's a better way of doing this without messing up the entire canvases on the app. Since you want it specifically for the drawer, try this approach.

   drawer: Theme(
      data: Theme.of(context).copyWith(
       // Set the transparency here
       canvasColor: Colors.transparent, //or any other color you want. e.g
      child: Drawer(
          // All other codes goes here.