juliansteenbakker / nordic_dfu

Execute a Device Firmware Update (DFU) on your nRF51 or nRF52 chip from Nordic Semiconductor. Fork from flutter_nordic_dfu.
MIT License
28 stars 29 forks source link

No implementation found for method startDfu on channel dev.steenbakker.nordic_dfu/method #136

Open SahilShirsat17 opened 7 months ago

SahilShirsat17 commented 7 months ago

ElevatedButton( onPressed: () async {

                  FlutterDocumentPickerParams params =
                  FlutterDocumentPickerParams(
                    allowedFileExtensions: ['zip'],
                  );

                  path =
                  (await FlutterDocumentPicker.openDocument(
                      params: params)
                      .onError((error, stackTrace) {
                        print("the error is $error");
                    return null;
                  }))!;
                  if (path.isNotEmpty) {
                    print('File path : $path');
                    try{
                      await NordicDfu().startDfu(
                        widget.connectedDevice.remoteId.toString(),
                        path,
                        fileInAsset: true,
                        onProgressChanged: (
                            deviceAddress,
                            percent,
                            speed,
                            avgSpeed,
                            currentPart,
                            partsTotal,
                            ) {
                          print('deviceAddress: $deviceAddress, percent: $percent');
                        },
                      );
                    }catch (e){
                      print("e");
                    }
                  } else {
                    // User canceled the picker
                  }
                },

                child: const Text("Select"),
              )

This is my code this is showing the error No implementation found for method startDfu on channel dev.steenbakker.nordic_dfu/method