Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FButton的text文字不能正常显示 #2

Closed
Francis-ChinaFeng opened this issue May 23, 2020 · 4 comments
Closed

FButton的text文字不能正常显示 #2

Francis-ChinaFeng opened this issue May 23, 2020 · 4 comments

Comments

@Francis-ChinaFeng
Copy link

你好,我在给FButton设置了height属性,text文字无法正常显示

appBar: AppBar(
        actions: _topBarActions,
        bottom: PreferredSize(
          preferredSize: Size.fromHeight(44.0),
          child: ListTile(
            leading: Image.asset("images/holder.png"),
            trailing: FButton(
              text: "编辑资料",
              width: 120,
              height: 28.0,
              effect: true,
              textColor: Colors.white,
              color: Color.fromARGB(0, 0, 0, 0),
              strokeWidth: 1,
              corner: FButtonCorner.all(2.0),
              strokeColor: Colors.white,
              onPressed: () {},
            ),
          ),
        ),
      )

经过多次测试,当我设置了height属性后,文字就丢失了。

@chenBingX
Copy link
Member

你好开发者,在 FButton 中,由于考虑到只设置文字,而没设置尺寸的场景下的展示问题,会默认有一个内间距 Padding。它的大小是:EdgeInsets.symmetric(horizontal: 16.0, vertical: 16)。目前,你可以通过为 FButton 配置 padding 属性覆盖该默认配置。

FButton(
  padding: EdgeInsets.zero,
)

在后续的版本中,我们会仔细评估在配置了尺寸信息后,是否应该自动去掉默认内间距。欢迎保持对 FWidget 的关注哦!😄

@co3318co
Copy link

真想给你一个么么哒

@chenBingX
Copy link
Member

Hi,
在最新的 1.1.0 版本中, FButton 的默认内间距遭到了移除。

新版依赖方式:

fbutton: ^1.1.0

@Francis-ChinaFeng
Copy link
Author

Hi,
在最新的 1.1.0 版本中, FButton 的默认内间距遭到了移除。

新版依赖方式:

fbutton: ^1.1.0

3Q

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants