Flutter 如何改变脚手架内容器的亮度

Flutter 如何改变脚手架内容器的亮度,flutter,Flutter,我需要更改脚手架内容器的亮度,代码片段如下所示。 欢迎任何提示或建议 PS:我检查了文档,但更改亮度的示例是针对MaterialApp,而不是针对脚手架内的容器 return Scaffold( backgroundColor: Colors.white, appBar: AppBar( brightness: Brightness.light, title: Text( "My Card brightness

我需要更改脚手架内容器的亮度,代码片段如下所示。 欢迎任何提示或建议

PS:我检查了文档,但更改亮度的示例是针对MaterialApp,而不是针对脚手架内的容器

return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(
        brightness: Brightness.light,
        title: Text(
          "My Card brightness",
          style: TextStyle(color: Colors.white),
        ),
        leading: IconButton(
          icon: Icon(Icons.arrow_back_ios, color: Colors.white),
          onPressed: () => Navigator.of(context).pop(),
        ),
      ),
      body: SingleChildScrollView(
          child: Column(children: <Widget>[
        Card(
            color: Color.fromARGB(255, 247, 247, 247),
            margin: const EdgeInsets.fromLTRB(10, 10, 10, 40),
            child: Column(
              children: <Widget>[
                // logo
                Row(
                  children: <Widget>[
                    Padding(
                        padding: const EdgeInsets.all(10.0),
                        child: Container(
                          width: 100,
                          //height: 80,
                          alignment: Alignment.center,
                          decoration: BoxDecoration(
                            color: Color.fromARGB(255, 0, 0, 0),
                            shape: BoxShape.rectangle,
                          ),
                          // i need increase brightness here
                          child: Container(
                              width: 90,
                              child: Image.network(
                                '${widget.logo}',
                                fit: BoxFit.fitWidth,
                              )),
                        )),
                  ],
                ),
返回脚手架(
背景颜色:Colors.white,
appBar:appBar(
亮度:亮度,亮度,
标题:正文(
“我的卡片亮度”,
样式:TextStyle(颜色:Colors.white),
),
领先:IconButton(
图标:图标(Icons.arrow\u back\u ios,颜色:Colors.white),
onPressed:()=>Navigator.of(context.pop(),
),
),
正文:SingleChildScrollView(
子项:列(子项:[
卡片(
颜色:color.fromARGB(255,247,247,247),
边距:LTRB(10,10,10,40)的常数边集,
子:列(
儿童:[
//标志
划船(
儿童:[
填充物(
填充:常数边集全部(10.0),
子:容器(
宽度:100,
//身高:80,
对齐:对齐.center,
装饰:盒子装饰(
颜色:color.fromARGB(255,0,0,0),
形状:BoxShape.rectangle,
),
//我需要增加这里的亮度
子:容器(
宽度:90,
孩子:Image.network(
“${widget.logo}”,
适合:BoxFit.fitWidth,
)),
)),
],
),

您可以将
Scaffold
backgroundColor
参数设置为您选择的不同颜色


我认为现在仍然不可能仅更改
脚手架的亮度。但是,您可以将颜色添加到
脚手架
并将不透明度添加到其中:

例如:

Scaffold(
  backgroundColor: Colors.white.withOpacity(0.8),
  appBar: AppBar(
    title: Text(
      "My Card",
      style: TextStyle(color: Colors.white),
    ),
    leading: IconButton(
      icon: Icon(Icons.arrow_back_ios, color: Colors.white),
      onPressed: () => Navigator.of(context).pop(),
    ),
  ),
  body: null,
  );

注意:不透明度的值范围在0.0-1.0之间

您可以将Scaffold的
backgroundColor
属性设置为您喜欢的颜色。我还尝试将容器包装为带有亮度.light的主题,但这并没有真正起到作用。我已经按照上面的建议进行了操作,但没有起到作用,我需要的是更改brigh脚手架内容器的亮度我不确定我是否理解你想做什么。你可以改变颜色,你不能改变脚手架的实际亮度。要使它看起来“更亮”,你可以使页面上的其他元素更暗。
Scaffold(
  backgroundColor: Colors.white.withOpacity(0.8),
  appBar: AppBar(
    title: Text(
      "My Card",
      style: TextStyle(color: Colors.white),
    ),
    leading: IconButton(
      icon: Icon(Icons.arrow_back_ios, color: Colors.white),
      onPressed: () => Navigator.of(context).pop(),
    ),
  ),
  body: null,
  );