MissingPluginException(No implementation found for method...?

48 Views Asked by At

Hello I'm using the flutter file dialog library https://pub.dev/packages/flutter_file_dialog

It throws a MissingPluginException error When not selecting the file in dialogFile.After clicking the file dialog It throws an already open dialog error. When restarting (close/start) the app and clicking the file dialogue the same error MissingPluginException Also, I tried another file dialogue library(https://pub.dev/packages/file_picker) is the same error. Is there any way to close the file dialogue or solution? My flutter version is;

Flutter (Channel stable, 3.7.10, on Microsoft Windows [Version 10.0.19045.4170], locale tr-TR) Windows Version (Installed version of Windows is version 10 or higher) Android toolchain - developed for Android devices (Android SDK version 34.0.0) Android Studio (version 2021.2) and kotlin version 1.7.0

gradle:7.3.1

Select Logo from dialogue;

            try {
  final params = OpenFileDialogParams(
    dialogType: OpenFileDialogType.image,
    sourceType: SourceType.photoLibrary,
  );
  final filePath = await FlutterFileDialog.pickFile(params: params);

  if (p.extension(filePath) != '.png' &&
      p.extension(filePath) != '.jpeg' &&
      p.extension(filePath) != '.jpg') {
    AppService.helper.showSnackBar(
        TranslateLanguage.of(context).localisedString(
            'error_extension', {'ext': '.jpeg,png or jpg'}),
        false,
        this.context);
  } else {
    setState(() {
      _isLoading = false;
      _path = filePath;
    });
  }
} on PlatformException {
  //_logException('Unsupported operation' + e.toString());
} catch (e) {
  //_logException(e.toString());
}       
After select file in another page
   File fileLog = await FLog.exportLogs();
                      Uint8List dataLog = fileLog.readAsBytesSync();
                      final params = SaveFileDialogParams(
                          data: dataLog,
                          fileName: "LogFile_" +
                              AppService.device.serialNumber +
                              "_" +
                              DateFormat("MM-dd-yyyy")
                                  .format(DateTime.now()) +
                              ".txt",
                          localOnly: false);
                      // final filePath =
                      await FlutterFileDialog.saveFile(params: params);
                    } catch (e) {
                      print(e.toString());
                    }
0

There are 0 best solutions below