英文:
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(),
],
)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论