我如何使用我的api instagram链接字段,当我点击它,它会打开instagram页面或任何url?
现在我的小部件变量给出这个错误
参数类型'Null Function(dynamic)'不能分配给参数类型'void Function()'。
IconButton(
icon: FaIcon(FontAwesomeIcons.facebook),
onPressed: (widget.company.social_instagram.toString()) { print("Pressed"); }
),
import 'package:url_launcher/url_launcher.dart';
IconButton(
icon: FaIcon(FontAwesomeIcons.facebook),
onPressed: () {
print(Uri.parse(widget.company.social_instagram.toString()));
launchUrl(Uri.parse(widget.company.social_instagram.toString()));
print("Pressed");
}
),