addShortcuts method
Implementation
@override
Future<bool?> addShortcuts(String title, String url) async {
try {
return await methodChannel
.invokeMethod<bool>('addShortcuts', {'title': title, 'url': url});
} on PlatformException catch (e) {
Fluttertoast.showToast(
msg: "添加快捷方式失败: ${e.message}", toastLength: Toast.LENGTH_LONG);
return false;
} catch (e) {
Fluttertoast.showToast(
msg: "添加快捷方式失败: 未知错误", toastLength: Toast.LENGTH_LONG);
return false;
}
}