bluetooth_print
bluetooth_print copied to clipboard
Error running this package's example app: type '(MethodCall) => Null' is not a subtype of type '((MethodCall) => Future<dynamic>)?' in type castW
When I execute the example app included in the package, the following error occurs.
════════ Exception caught by widgets library ═══════════════════════════════════
The following _CastError was thrown attaching to the render tree:
type '(MethodCall) => Null' is not a subtype of type '((MethodCall) => Future
When the exception was thrown, this was the stack
#0 new BluetoothPrint._
package:bluetooth_print/bluetooth_print.dart:26
#1 BluetoothPrint._instance
package:bluetooth_print/bluetooth_print.dart:29
#2 BluetoothPrint._instance (package:bluetooth_print/bluetooth_print.dart)
package:bluetooth_print/bluetooth_print.dart:1
#3 BluetoothPrint.instance
package:bluetooth_print/bluetooth_print.dart:31
#4 new _MyAppState
package:print_ticket/main.dart:17
#5 MyApp.createState
package:print_ticket/main.dart:13
#6 new StatefulElement
package:flutter/…/widgets/framework.dart:4754
#7 StatefulWidget.createElement
package:flutter/…/widgets/framework.dart:737
#8 Element.inflateWidget
package:flutter/…/widgets/framework.dart:3668
#9 Element.updateChild
package:flutter/…/widgets/framework.dart:3425
#10 RenderObjectToWidgetElement._rebuild
package:flutter/…/widgets/binding.dart:1198
#11 RenderObjectToWidgetElement.mount
package:flutter/…/widgets/binding.dart:1167
#12 RenderObjectToWidgetAdapter.attachToRenderTree.
Not a good practice, but you can change the below changes manually in the package.
https://github.com/DeadBryam/bluetooth_print/commit/1f15040f674b2f593f83b595cc2b9dc29569309e
Hello,
I have the same problem, what can I do?
Hello,
I have the same problem, what can I do?
I have also this issue.
hello, I am also having the same issue. Hopefully it will be resolved. Thank you
just change your package code -> bluetooth_print.dart from :
BluetoothPrint._() { _channel.setMethodCallHandler((MethodCall call) { _methodStreamController.add(call); return; } as Future<dynamic> Function(MethodCall)?); }
to this:
BluetoothPrint._() { _channel.setMethodCallHandler((MethodCall call) async{ _methodStreamController.add(call); return; }); }
This error breaks the package, they should fix this as soon as possible.
Please fix this simple issue
still not update ?