Flutter按钮,位于此文本下方,具有URL链接。

huangapple go评论51阅读模式
英文:

Flutter button with url link under this text

问题

你好,我想在这段代码下面添加一个按钮,以便可以重定向到一个网站。

英文:

Hi guys I would like to add button under this code
so that there will be redirection to a website.

class EmptyServiceSearch extends StatelessWidget {
  const EmptyServiceSearch({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return EmptyState(
      imageUrl: AppImages.emptySearch,
      title: "No Service/Provider Found".tr(),
      description: "There seems to be no Service/Provider".tr(),
      
    );
  } 
}

答案1

得分: 1

尝试在描述标签下添加一个主体,然后添加一个子元素以添加“Elevated Button”,这将为您创建一个按钮... 您可以根据需要以任何方式定位按钮

body: SingleChildScrollView(
  child: ElevatedButton(onPressed: onPressed, child: child),
英文:

You can try to add a body under the description tag and then add a child to add Elevated Button which will give you a button... You can try to position the button in whichever manner you want to

body: SingleChildScrollView(
      child: ElevatedButton(onPressed: onPressed, child: child),

答案2

得分: 0

你可以使用 Stack 来实现这一点。

Stack(
  children: [
    Button(),
    EmptyServiceSearch(),
  ],
)

如果你想在下方添加一个按钮,可以使用 Column 如下所示,

Column(
  children: [
    EmptyServiceSearch(),
    Button(),
  ],
)
英文:

You can use Stack to achieve this.

Stack(
  children: [
    Button(),
    EmptyServiceSearch(),
  ],
)

If you want to add a button below, the you can use Column as following,

Column(
  children: [
    EmptyServiceSearch(),
    Button(),
  ],
)

huangapple
  • 本文由 发表于 2023年2月24日 14:01:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/75553090.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定