BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi,
I'd like to add an annotation that is a row with two children (text, image). As long as the annotations widget is only text or only image it works fine, but as soon as I use row or column, the annotation is not displayed any more. :-(
Any idea what's wrong with my code / idea?
Please find my minimal example below.
Thanks for helping!
Sven
Hi Sven,
We are validating your query at our end and we will update further details in one business day on 14 March 2023. We appreciate your patience until then.
Regards,
Yuvaraj.
Hi Sven,
We have checked your query and found that you have wrapped the Text widget inside the Row widget and used it as annotation, in flutter if you added a Row widget without wrapping any other sized widget it will take all the available space in its parent widget. However, you can achieve your requirement by using the mainAxisSize property in Row and setting it to a minimum then it will take a size based on its child and not based on its parent. We have shared the code snippet below for your reference.
Code snippet:
annotations: [ CartesianChartAnnotation( widget: Row( mainAxisSize: MainAxisSize.min, children: const [ Text('Annotation'), FlutterLogo(), ], ), coordinateUnit: CoordinateUnit.point, x: 3, y: 2, ), ], |
Regards,
Yuvaraj.
Thanks for your help!
It works now perfectly fine!
Hi Sven,
Most Welcome. Kindly get back to us if you have further queries. We are always happy to assist you.
Regards,
Lavanya A.