Flutter MissingPluginException(MissingPluginException(在通道dexterx.dev/trail上找不到方法getTimeZoneName的实现))
我使用flatter本地通知进行调度,当我使用MethodChannel实例时,我得到一个异常 主要功能:Flutter MissingPluginException(MissingPluginException(在通道dexterx.dev/trail上找不到方法getTimeZoneName的实现)),flutter,dart,push-notification,Flutter,Dart,Push Notification,我使用flatter本地通知进行调度,当我使用MethodChannel实例时,我得到一个异常 主要功能: const MethodChannel platform = MethodChannel('dexterx.dev/apptrail'); void main() async { WidgetsFlutterBinding.ensureInitialized(); await _configureLocalTimeZone(); ru
const MethodChannel platform = MethodChannel('dexterx.dev/apptrail');
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await _configureLocalTimeZone();
runApp(MyApp());
}
Future<void> _configureLocalTimeZone() async {
tz.initializeTimeZones();
final String timeZoneName = await platform.invokeMethod('getTimeZoneName');
tz.setLocalLocation(tz.getLocation(timeZoneName));
}
Exception has occurred.
MissingPluginException (MissingPluginException(No implementation found for method getTimeZoneName on channel dexterx.dev/trail))
\u配置本地时区功能为:
const MethodChannel platform = MethodChannel('dexterx.dev/apptrail');
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await _configureLocalTimeZone();
runApp(MyApp());
}
Future<void> _configureLocalTimeZone() async {
tz.initializeTimeZones();
final String timeZoneName = await platform.invokeMethod('getTimeZoneName');
tz.setLocalLocation(tz.getLocation(timeZoneName));
}
Exception has occurred.
MissingPluginException (MissingPluginException(No implementation found for method getTimeZoneName on channel dexterx.dev/trail))
flatter\u local\u通知的示例代码具有本机机具部件
你可以参考
flatter\u local\u通知的示例代码具有本机机具部件
你可以参考
您尚未在本机端实现该方法。因此,当您从Flatter端调用该方法时,在搜索时在本机代码中找不到该方法,因此引发异常。您尚未在本机端实现该方法。因此,当您从Flatter一侧调用该方法时,在搜索时在本机代码中找不到它,因此引发异常。您是否在本机一侧为方法通道编写了实现?您是否在本机一侧为方法通道编写了实现?