gpt4 book ai didi

flutter - 如何在Flutter中正确添加共享插件

转载 作者:行者123 更新时间:2023-12-03 03:52:07 24 4
gpt4 key购买 nike


Stack(
children: <Widget>[
Container(
padding: EdgeInsets.only(left: 25),
child: Center(
child: Text(
texts[index],
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.normal,
color: Colors.black),
)),
),
Positioned(
bottom: 0,
right: 0,
child: FlatButton(
onPressed: () {
Share.share(texts[index]);
},
child: Text(
"Share",
style: TextStyle(
color: Colors.white,
fontFamily: 'serif',
fontWeight: FontWeight.bold),
)),
)
],
),

最佳答案

首先将此行添加到您的pubspec文件中:-url_launcher: ^5.4.2第二次使用此代码段:-

_launchURL() async {
const url = 'https://flutter.dev';
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}

final Uri _emailLaunchUri = Uri(
scheme: 'mailto',
path: 'smith@example.com',
queryParameters: {
'subject': 'Example Subject & Symbols are allowed!'
}
);

关于flutter - 如何在Flutter中正确添加共享插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62742940/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com