thon-ju / bluetooth_print

a flutter plugin connect to bluetooth thermal printer support both Android and IOS (eg. Gprinter pt-380、gp-1324、gp-2120)
MIT License
151 stars 188 forks source link

type '(MethodCall) => Null' is not a subtype of type '((MethodCall) => Future<dynamic>)?' in type cast #104

Open cristhianveal opened 2 years ago

cristhianveal commented 2 years ago

════════ 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)?' in type cast

😢

bluetooth_print: last version flutter version: 2.10.5

emilmammadov commented 2 years ago

any update?

yukitaka13-1110 commented 2 years ago

Any updates?

emilmammadov commented 2 years ago

I solved it with my fork at here: https://github.com/emilmammadov/bluetooth_print You can fork my code but I set the charset to ISO 8859-9 for Turkish characters. So if you will use another charset just change the commit with this SHA 11330f4129e332da772631dc6b62190b152f6955

Guthers commented 2 years ago

@thon-ju, can you please add the very simple change from here, essentially just adding the async to your call? https://github.com/emilmammadov/bluetooth_print/commit/68bc24913d0d7c4333dc268e47b8d1e2691da9f4#diff-ae86796ce5471cde755dcbe215a7deb765b7ffdb56671bd2ed4a248f2c7e65d8L23