mrtungdev / flutter_epson_epos

Flutter Epson ePOS SDK
MIT License
16 stars 24 forks source link

Incorrect use of ParentDataWidget #3

Closed stoto34 closed 3 years ago

stoto34 commented 3 years ago

Hello !

I tested this library with my Epson TM printer but I have one error when I run it :


The following assertion was thrown while applying parent data.:
Incorrect use of ParentDataWidget.

The ParentDataWidget Expanded(flex: 1) wants to apply ParentData of type FlexParentData to a RenderObject, which has been set up to accept ParentData of incompatible type BoxParentData.

Usually, this means that the Expanded widget has the wrong ancestor RenderObjectWidget. Typically, Expanded widgets are placed directly inside Flex widgets.
The offending Expanded is currently placed inside a Padding widget.

The ownership chain for the RenderObject that received the incompatible parent data was:
  Column ← Expanded ← MediaQuery ← Padding ← SafeArea ← _BodyBuilder ← MediaQuery ← LayoutId-[<_ScaffoldSlot.body>] ← CustomMultiChildLayout ← AnimatedBuilder ← ⋯
When the exception was thrown, this was the stack

Any idea to solve this ? Thank you very much for this library 
mrtungdev commented 3 years ago

Please check your widget :)

stoto34 commented 3 years ago

I used the sample provide here https://github.com/ImTung/flutter_epson_epos/blob/main/example/lib/main.dart

mrtungdev commented 3 years ago

oh so sorry. What's your flutter version? did you run release mode?

I'll update the example when this package is stable. Thank you so much

stoto34 commented 3 years ago

No worries. I'm using Flutter 2.5.1 and I run it in debug mode on an emulator device (API 27) Thank you very much for your work, very usefull !