ko2ic / image_downloader

Flutter plugin that downloads images and movies on the Internet and saves to Photo Library on iOS or specified directory on Android.
https://pub.dartlang.org/packages/image_downloader#-readme-tab-
MIT License
92 stars 113 forks source link

Linux support [Feature request] #105

Open nonetrix opened 2 years ago

nonetrix commented 2 years ago

Issue:

Error:

[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: MissingPluginException(No implementation found for method downloadImage on channel plugins.ko2ic.com/image_downloader)
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:7)
<asynchronous suspension>
#1      _MyHomePageState.downloadImage (package:renti/main.dart:83:5)
<asynchronous suspension>

Code:

  void downloadImage() async {
    Fluttertoast.showToast(
        msg: "Downloading.",
        toastLength: Toast.LENGTH_SHORT,
        gravity: ToastGravity.BOTTOM,
        timeInSecForIosWeb: 1,
        backgroundColor: Colors.black,
        textColor: Colors.white,
        fontSize: 16.0
    );

    await ImageDownloader.downloadImage(imageUrl);

    Fluttertoast.showToast(
        msg: "Downloaded.",
        toastLength: Toast.LENGTH_SHORT,
        gravity: ToastGravity.BOTTOM,
        timeInSecForIosWeb: 1,
        backgroundColor: Colors.black,
        textColor: Colors.white,
        fontSize: 16.0
    );
  }

expected behavior:

I am very new to flutter so I could be wrong in someway