【发布时间】:2021-06-20 07:40:58
【问题描述】:
我收到“type 'Futture' is not a subtype of type '() => void'”错误,我只是想知道如何解决这个错误。任何建议或帮助都会非常感激。
GestureDetector(
onTap: _launchURL(),
child: Text(
'maxis@gm.com',
style: TextStyle(
fontSize: 16,
color: Theme.of(context).indicatorColor),
),
),
_launchURL() async {
final url =
Uri.encodeFull('mailto:smith@example.org?subject=News&body=New plugin');
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
``
【问题讨论】:
标签: flutter dart flutter-layout flutter-dependencies flutter-web