[英]how to open other install app in my flutter app?
i see this document => https://github.com/doxtitech/url_launcher_package_example/blob/master/lib/main.dart我看到这个文件=> https://github.com/doxtitech/url_launcher_package_example/blob/master/lib/main.dart
but I don't want to open the 'mailto'.但我不想打开'mailto'。
If the app package name is 'kr.go.eduro.hcs', how can I open that app when I press the button?如果应用程序 package 名称是 'kr.go.eduro.hcs',当我按下按钮时如何打开该应用程序?
My CODE:我的代码:
class _CoronaSubScreenState extends State<CoronaSubScreen> {
void customLaunch(command) async {
if (await canLaunch(command)) {
await launch(command);
} else {
print('$command is not load');
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
onPressed: () {
customLaunch('kr.go.eduro.hcs');
},
child: Text(
'self',
),
),
],
),
),
);
}
}
If you know application package name, you can do by using ' device_apps ' package.如果您知道应用程序 package 名称,则可以使用“ device_apps ”package 来完成。
// Check whether app is installed
bool isInstalled = await DeviceApps.isAppInstalled('com.frandroid.app');
// Call open the application what you want
DeviceApps.openApp('com.frandroid.app');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.