cubanGuy
cubanGuy

Reputation: 1296

Flutter change color of drawer scrim

Is it possible o change the color or transparency of the drawer's scrim in flutter? Something like is Java's drawerLayout.setScrimColor(Color.TRANSPARENT);?

Thanks.

Upvotes: 1

Views: 2172

Answers (3)

Hrvoje Čukman
Hrvoje Čukman

Reputation: 447

You can change drawerTheme like this:

return ThemeData(
      drawerTheme: DrawerThemeData(
        scrimColor: Colors.transparent,
      ),
    );

Upvotes: 0

MarcoFerreira
MarcoFerreira

Reputation: 378

Following the same ideia brought by @diegoveloper and for that who might wonder how to make transparency just use the transparent color drawerScrimColor: Colors.transparent

https://api.flutter.dev/flutter/material/Colors/transparent-constant.html

Upvotes: 0

ThinkDigital
ThinkDigital

Reputation: 3539

Flutter now includes a drawerScrimColor parameter in the Scaffold widget.

For example:

Scaffold(
      drawerScrimColor: Colors.black,
);

Although I answered the question, @diegoveloper deserves the credit for submitting the PR

Upvotes: 2

Related Questions