jaumard / sms_autofill

Flutter plugin to provide SMS code autofill support
MIT License
289 stars 183 forks source link

Crash Error: Error: No named parameter with the name 'contextMenuBuilder'. #235

Open weluid opened 1 month ago

weluid commented 1 month ago

After updating Target SDK to 34 and sms_autofill to 2.4.0 i have this error during building

../../.pub-cache/hosted/pub.dev/sms_autofill-2.4.0/lib/sms_autofill.dart:126:7: Error: No named parameter with the name 'contextMenuBuilder'. contextMenuBuilder: (context, editableTextState) { ^^^^^^^^^^^^^^^^^^ ../../.pub-cache/hosted/pub.dev/pin_input_text_field-4.4.1/lib/src/widget/pin_widget.dart:70:3: Context: Found this candidate, but the arguments don't match. PinInputTextField({ ^^^^^^^^^^^^^^^^^ Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

BUILD FAILED in 32s Exception: Gradle task assembleDebug failed with exit code 1

CarlosPinheiro96 commented 1 month ago

Same!

After the target sdk update (34) this exact same error show up

conanlovevit commented 4 weeks ago

same for me

conanlovevit commented 4 weeks ago

@jaumard Pls support us with this issue

pramodshresth commented 3 weeks ago

@jaumard any solution?

comancheo commented 2 weeks ago

Cause: old version of flutter, so package PinInputTextField is resolved with version 4.4.1, but code of sms_aufotill is for 4.5.0+... You can easily fork and remove contextMenuBuilder: (context, editableTextState) { final List<ContextMenuButtonItem> buttonItems = editableTextState.contextMenuButtonItems; return AdaptiveTextSelectionToolbar.buttonItems( anchors: editableTextState.contextMenuAnchors, buttonItems: buttonItems, ); },

and just add toolbarOptions: ToolbarOptions(paste: true), in sms_autofill/lib/sms_autofill.dart:126 (version 2.4.0)

  Hope author will resolve this in close future.