Я использовал несколько библиотек для обмена контентом на flutter android / iOS до недавнего времени я хотел реализовать функциональность обмена на flutter WEB. Хотя я использовал те же библиотеки, но выдает ошибку MissingPluginException. Что, скорее всего, связано с отсутствием конфигурации для веб-платформы Flutter.
Overflow on channel: social_share. Messages on this channel are being discarded in FIFO fashion. The engine may not be running or you need to adjust the buffer size if of
the channel.
Error: MissingPluginException(No implementation found for method shareWhatsapp on channel social_share)
at Object.throw_ [as throw] (http://localhost:58884/dart_sdk.js:4314:11)
at MethodChannel._invokeMethod (http://localhost:58884/packages/flutter/src/services/platform_channel.dart.lib.js:410:21)
at _invokeMethod.next (<anonymous>)
at http://localhost:58884/dart_sdk.js:37184:33
at _RootZone.runUnary (http://localhost:58884/dart_sdk.js:37038:58)
at _FutureListener.thenAwait.handleValue (http://localhost:58884/dart_sdk.js:32022:29)
at handleValueCallback (http://localhost:58884/dart_sdk.js:32569:49)
at Function._propagateToListeners (http://localhost:58884/dart_sdk.js:32607:17)
at _Future.new.[_completeWithValue] (http://localhost:58884/dart_sdk.js:32450:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:58884/dart_sdk.js:32472:35)
at Object._microtaskLoop (http://localhost:58884/dart_sdk.js:37299:13)
at _startMicrotaskLoop (http://localhost:58884/dart_sdk.js:37305:13)
at http://localhost:58884/dart_sdk.js:32824:9
Код:
class SocialMediaLogo extends StatelessWidget {
final String logo;
SocialMediaLogo(this.logo);
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.all(5),
child: RaisedButton(
onPressed: () async {
SocialShare.shareWhatsapp("Hello World \n https://google.com")
.then((data) {
print(data);
});
},
child: Image(
image: AssetImage("icons/$logo.png"),
height: 35,
width: 35,
fit: BoxFit.cover,
)),
);
}
}
Есть ли способ сделать это? Или какой-либо реализованный веб-плагин для этого?