score:0

Accepted answer

for changing the background color of drawer you can just swap the drawer widget with container and give color to container

class mydrawer extends statelesswidget {
@override
  widget build(buildcontext context) {
    return drawer(
        elevation: 0,
        child: container(
          color: colors.blue,
        child: listview(
          children: <widget>[
            container(
              height: 170,
              width: 170,
              padding: edgeinsets.only(top:30),
              color: colors.red,
              child: column(children: <widget>[
                material(
                  borderradius: borderradius.all(radius.circular(100)),
                  child: padding(padding: edgeinsets.all(20.0),
                  child: image.asset('images/circle.png',width: 80, height: 80,),),
                ),
              ],),
            ),
            container(
              color: colors.red,
              child: column(
                children: <widget>[
                  listtile(
                    leading: icon(icons.help_outline_sharp),
                    title: text('help', style: textstyle(fontsize: 18,),),
                    ontap: () {},
                  ),
                  listtile(
                    leading: icon(icons.person),
                    title: text('about us', style: textstyle(fontsize: 18,),),
                    ontap: () {},
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}

this can be the final code you can use, it has answer to all your three questions

class mydrawer extends statelesswidget {
 @override
  widget build(buildcontext context) {
    return drawer(
      child: column(
        children: <widget>[
          expanded(
            child: listview(
              children: <widget>[
                container(
                  height: 170,
                  width: 170,
                  padding: edgeinsets.only(top:30),
                  color: colors.blue,
                  child: column(children: <widget>[
                    material(
                      borderradius: borderradius.all(radius.circular(100)),
                      child: padding(padding: edgeinsets.all(20.0),
                                     child: image.asset('images/circle.png',width: 80, height: 80,),),
                    ),
                  ],
                 ),
                ),
                listtile(
                  leading: icon(icons.help_outline_sharp),
                  title: text('help', style: textstyle(fontsize: 18,),),
                  ontap: () {},
                ),
                listtile(
                  leading: icon(icons.person),
                  title: text('about us', style: textstyle(fontsize: 18,),),
                  ontap: () {},
                ),
              ],
            ),
          ),
          align(
            alignment: alignment.bottomcenter,
            child: listtile(
              leading: icon(icons.logout),
              title: text('logout')
            ),
          ),
        ],
      ),
    );
  }
}

score:0

to change the color, wrap the drawer widget in a theme widget as follows:

scaffold(
  drawer:theme(
    data:theme.of(context).copywith(
     canvascolor://the desired color will go here
    ),
    child:drawer(/*drawer content*/)
  )
)

hope this is useful for someone


Related Query

More Query from same tag