MissingPluginException(在频道 flutter_email_sender 上找不到方法发送的实现)

时间:2021-07-25 17:04:03

标签: firebase email flutter-web

从 Flutter Web 发送邮件。尝试向 TextFormField 中输入的收件人电子邮件发送带有安全代码的电子邮件。

import 'package:flutter_email_sender/flutter_email_sender.dart';

 final Email email = Email(
      body: _bodyController.text,
      subject: _subjectController.text,
      recipients: [_recipientController.text],
      attachmentPaths: attachments,
      isHTML: isHTML,
    );

    String platformResponse;

    try {
      await FlutterEmailSender.send(email);
      platformResponse = 'success';
    } catch (error) {
      platformResponse = error.toString();
    }

    if (!mounted) return;

    ScaffoldMessenger.of(context).showSnackBar(
      SnackBar(
        content: Text(platformResponse),
      ),
    );

pubspec.yaml

flutter_email_sender: ^5.0.2

错误:

MissingPluginException(No implementation found for method send on channel flutter_email_sender)

使缓存无效/重启后问题仍然存在。 有谁知道如何解决这个问题?谢谢!

1 个答案:

答案 0 :(得分:0)

目前网络平台不支持 flutter_email_sender 插件。

显示的错误消息 MissingPluginException(No implementation found for method send on channel flutter_email_sender) 表明了这一点。

pub.dev 中可用的所有软件包都有一些指示支持平台的标签。