Flutter 如何为整个抽屉设置背景图像而不是画布颜色? 主题( 数据:Theme.of(context).copyWith( 画布颜色:ColorPallete().浅黑色, ), 孩子:抽屉( 子:ListView( 儿童:[专栏]( 儿童:[ 容器( 身高:204.0, 儿童:抽屉阅读器( 子:堆栈( 儿童:[ 居中( 子:列( 儿童:[ 点边界( 填充:所有边缘设置(5.0), borderType:borderType.Circle, 颜色:ColorPallete().白色, 子:容器( 身高:74.38, 宽度:74.38, 孩子:圆环星( 背景颜色:颜色(0xFFDADADA), ), ), ), 尺寸箱(高度:11.0,), 文本('crmk_ааааааааааааааа1072( fontSize:14.0,颜色:ColorPallete().白色 ),) ], ), ), 定位( 底部:0, 右:0,, 孩子:排( 儿童:[ 文本('bыццццццццццццццц, 尺寸控制盒(宽度:7.0,), 图标(图标。向前箭头,颜色:ColorPallete()。黄色,尺寸:18.0,), ], ), ) ] ), ), ),

Flutter 如何为整个抽屉设置背景图像而不是画布颜色? 主题( 数据:Theme.of(context).copyWith( 画布颜色:ColorPallete().浅黑色, ), 孩子:抽屉( 子:ListView( 儿童:[专栏]( 儿童:[ 容器( 身高:204.0, 儿童:抽屉阅读器( 子:堆栈( 儿童:[ 居中( 子:列( 儿童:[ 点边界( 填充:所有边缘设置(5.0), borderType:borderType.Circle, 颜色:ColorPallete().白色, 子:容器( 身高:74.38, 宽度:74.38, 孩子:圆环星( 背景颜色:颜色(0xFFDADADA), ), ), ), 尺寸箱(高度:11.0,), 文本('crmk_ааааааааааааааа1072( fontSize:14.0,颜色:ColorPallete().白色 ),) ], ), ), 定位( 底部:0, 右:0,, 孩子:排( 儿童:[ 文本('bыццццццццццццццц, 尺寸控制盒(宽度:7.0,), 图标(图标。向前箭头,颜色:ColorPallete()。黄色,尺寸:18.0,), ], ), ) ] ), ), ),,flutter,background,drawer,Flutter,Background,Drawer,使用容器小部件作为您的抽屉,然后一堆背景图像和抽屉的项目应该是容器的子项 Theme( data: Theme.of(context).copyWith( canvasColor: ColorPallete().lightBlack, ), child: Drawer( child: ListView( children: <Widget>[Column( children

使用
容器
小部件作为您的抽屉,然后一堆
背景图像
抽屉的项目
应该是容器的子项

Theme(
      data: Theme.of(context).copyWith(
        canvasColor: ColorPallete().lightBlack,
      ),
      child: Drawer(
        child: ListView(
          children: <Widget>[Column(
            children: <Widget>[
              Container(
                height: 204.0,
                child: DrawerHeader(
                  child:  Stack(
                      children:<Widget>[
                        Center(
                          child: Column(
                            children: <Widget>[
                              DottedBorder(
                                padding: EdgeInsets.all(5.0),
                                borderType: BorderType.Circle,
                                color: ColorPallete().white,
                                child: Container(
                                  height: 74.38,
                                  width: 74.38,
                                  child: CircleAvatar(
                                    backgroundColor: Color(0xFFDADADA),
                                  ),
                                ),
                              ),
                              SizedBox(height: 11.0,),
                              Text('Иван Иванович Иванов',style: TextStyle(
                                  fontSize: 14.0,color: ColorPallete().white
                              ),)
                            ],
                          ),
                        ),
                        Positioned(
                          bottom: 0,
                          right: 0,
                          child: Row(
                            children: <Widget>[
                              Text('Выйти',style: TextStyle(fontSize: 14.0,color: ColorPallete().yellow),),
                              SizedBox(width: 7.0,),
                              Icon(Icons.arrow_forward,color: ColorPallete().yellow,size: 18.0,),
                            ],
                          ),
                        )
                      ]
                  ),
                ),
              ),
脚手架(
...,
抽屉:集装箱(
子:堆栈(
儿童:[
Image.asset(“myBackgroundImage.png”),
列表视图(
儿童:[
CircleAvater(),
ListTile(),
ListTile(),
...
],          
),    
],      
),      
),
);
    Scaffold(
      ...,
      drawer: Container(
      child: Stack(
        children: <Widget>[
          Image.asset("myBackgroundImage.png"),
          ListView(
            children: <Widget>[
            CircleAvater(),
            ListTile(),
            ListTile(),
            ...
            ],          
         ),    
        ],      
       ),      
      ),
     );