小编HAR*_*ISH的帖子

如何在 Flutter 中添加带有图标的按钮

我的应用程序中有一个按钮,例如

这个

下面是相同的代码

Widget loginButtonChild = const Text(
  "Log in",
  style: TextStyle(
    color: Colors.white,
    fontFamily: "OpenSans-Regular",
  ),
);


FlatButton.icon(
  shape: RoundedRectangleBorder(
    borderRadius: new BorderRadius.circular(18.0),
    side: BorderSide(color: Colors.red)),
  color: Colors.red,
  label: loginButtonChild, 
  icon: Icon(Icons.arrow_forward ), 
  onPressed: () {
   //some function
  },
)
Run Code Online (Sandbox Code Playgroud)

我正在尝试创建一个类似的按钮

这个

任何人都可以在这方面提供帮助或任何建议吗?

button dart flutter

3
推荐指数
1
解决办法
3392
查看次数

调整颤动中的底片

我的应用程序中有一个底部工作表,对于 5 + 尺寸的手机可以正确显示,但是当我在较小屏幕的手机上运行时,我会得到如下所示的结果

在此输入图像描述

问题在于填充跨越了范围,是否有其他方法来创建底片,并且其内容大小应该特定于设备?如何自动调整字体大小,以及根据设备特定的填充。

下面是相同的代码

showModalBottomSheet<void>(
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(10.0),
        ),
        context: context,
        isScrollControlled: true,
        builder: (BuildContext context) {
          return FractionallySizedBox(
              heightFactor: 0.2,
              child: Padding(
                  padding: const EdgeInsets.symmetric(
                    horizontal: 22.0,
                    vertical: 14.0,
                  ),
                  child: Column(
                    children: <Widget>[
                      ListTile(
                          leading: Icon(Icons.remove_red_eye),
                          title: Text(
                            "View",
                            overflow: TextOverflow.ellipsis,
                            textAlign: TextAlign.justify,
                            maxLines: 1,
                            style: TextStyle(
                              fontSize:
                                  ScreenUtil(allowFontScaling: true).setSp(50),
                            ),
                          ),
                          onTap: () {
                            Navigator.of(context).pop();
                            setGenerateReportView(context, count, data);
                          }),
                      ListTile(
                          leading: Icon(Icons.file_download),
                          title: Text(
                            "Download",
                            overflow: TextOverflow.ellipsis,
                            textAlign: TextAlign.justify,
                            maxLines: 1,
                            style: TextStyle(
                              fontSize: …
Run Code Online (Sandbox Code Playgroud)

flutter bottom-sheet

3
推荐指数
2
解决办法
5649
查看次数

标签 统计

flutter ×2

bottom-sheet ×1

button ×1

dart ×1