openSettings method
打开设置页面
Implementation
@override
void openSettings() {
try {
// 通过 channel 调用原生打开设置方法,并传递震动时长(单位:毫秒)
methodChannel.invokeMethod('openSettings');
} on PlatformException catch (e) {
// 捕获异常并打印错误信息
print("Error openSettings: ${e.message}");
}
}