android - Flutter-可以将边框半径赋予扩展面板列表吗?如果是,应该使用哪些属性

标签 android flutter android-layout dart flutter-layout

我有扩展面板列表的代码,它工作正常,但我无法扩展扩展面板的大小。另外,我希望扩展面板有一个边框半径,但我不确定是否可以给出边框半径

return Column(children: [
  Stack(
    clipBehavior: Clip.none,
    children: [
      Padding(
        padding: const EdgeInsets.symmetric(horizontal: 50),
        child: ExpansionPanelList(
          animationDuration: Duration(milliseconds: 1000),
          children: [
            ExpansionPanel(
                headerBuilder: (context, isExpanded) {
                  return Column(
                    children: [
                      Text("Salmon Poké"),
                      Text("Rs. 2000"),
                    ],
                  );
                },

                body: Text(
                  'This salmon sashimi is a delicious light appetizer served with fresh wasabi, ginger, soy sauce or a delicious side of soy yuzo citrus ponzu.',
                  style: TextStyle(
                    fontSize: 18,
                    color: Colors.black,
                  ),
                ),
                isExpanded: _expanded,
                canTapOnHeader: true,
                backgroundColor: Colors.white),
          ],
          dividerColor: Colors.grey,
          expansionCallback: (panelIndex, isExpanded) {
            _expanded = !_expanded;
            setState(() {});
          },
        ),
      ),

      Positioned(
        top: -55,
        right: 240,
        child: CircleAvatar(
          radius: 105,
          child: ClipOval(
            child: Image(
              image: AssetImage('assets/images/salmon.png'),
            ),
          ),

          backgroundColor: Colors.transparent,
        ),
      ),
    ],
  ),
]);

} }

**这是给定代码的 UI **

This is the output I have.

这是我想要的输出。 (此 UI 是使用容器小部件制作的,但我希望此布局使用扩展面板列表)

This is the output that I want

我非常感谢您的帮助。

最佳答案

将 ExpansionPanelList 包装在 ClipRRect 中。


ClipRRect(
  borderRadius: BorderRadius.circular(8),
  child: ExpansionPanelList(
     children: [ExpansionPanel(body: Text('Hello World'))])
)

关于android - Flutter-可以将边框半径赋予扩展面板列表吗?如果是,应该使用哪些属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68716265/

相关文章:

java - 在后台运行一段时间后关闭应用程序

java - fragment 启动时java.lang.NullPointerException的错误

java - 创建多层绘图时避免出现对象分配警告

android - 如何扩展 ActionBar

具有自定义项目复杂布局的 Android ExpandableListView

android - 允许不安全的协议(protocol),android gradle

android - API 级别 < 11 中的 ObjectAnimator

flutter - 如何在flutter中从Stripe信用卡获取tokenID

flutter - CocoaPods 要求您的终端使用 UTF-8 编码。考虑将以下内容添加到 ~/.profile。导出 LANG=en_US.UTF-8

firebase - StreamBuild:流,调用返回Firestore流的方法直到更新才检索数据