syncfusion / flutter-widgets

Syncfusion Flutter widgets libraries include high quality UI widgets and file-format packages to help you create rich, high-quality applications for iOS, Android, and web from a single code base.
1.55k stars 756 forks source link

method 'markNeedsBuild' isn't defined for the class 'RenderConstrainedLayoutBuilder<Constraints, RenderObject>' #2045

Open chirastefan opened 2 weeks ago

chirastefan commented 2 weeks ago

Bug description

Error (Xcode): ../../../.pub-cache/hosted/pub.dev/syncfusion_flutter_charts-26.2.11/lib/src/charts/cartesian_chart.dart:1367:22: Error: The method 'markNeedsBuild' isn't defined for the class 'RenderConstrainedLayoutBuilder<Constraints, RenderObject>'.

version ^26.2.11

Steps to reproduce

install that version and try to run a dart project locally using ios simulator iPhone 11 Pro

Code sample

Code sample ```dart void _buildTrackballWidget(List details) { final TrackballBehavior trackballBehavior = widget.trackballBehavior!; final List chartPointInfo = trackballBehavior.chartPointInfo; if (details.isEmpty || trackballBehavior.builder == null) { _trackballBuilder = const SizedBox(width: 0, height: 0); } else if (details.isNotEmpty && trackballBehavior.builder != null && chartPointInfo.isNotEmpty) { _trackballBuilder = Stack( children: List.generate(details.length, (int index) { final ChartPointInfo info = chartPointInfo[index]; final Widget builder = trackballBehavior.builder!.call(context, details[index]); return TrackballBuilderRenderObjectWidget( index: index, xPos: info.xPosition!, yPos: info.yPosition!, builder: builder, chartPointInfo: chartPointInfo, trackballBehavior: trackballBehavior, child: builder, ); }).toList(), ); } final RenderObjectElement? trackballBuilderElement = _trackballBuilderKey.currentContext as RenderObjectElement?; if (trackballBuilderElement != null && trackballBuilderElement.mounted && trackballBuilderElement.renderObject.attached) { final RenderObject? renderObject = trackballBuilderElement.findRenderObject(); if (renderObject != null && renderObject.attached && renderObject is RenderConstrainedLayoutBuilder) { renderObject.markNeedsBuild(); } } } ``` inside `/Users/me/.pub-cache/hosted/pub.dev/syncfusion_flutter_charts-26.2.11/lib/src/charts/cartesian_chart.dart`

Screenshots or Video

Screenshots / Video demonstration Screenshot 2024-08-30 at 00 18 33 ![Screenshot 2024-08-29 at 23 59 16](https://github.com/user-attachments/assets/64b3f9a3-e29b-4737-adde-4500a9ca9698)

Stack Traces

Stack Traces ```dart Error (Xcode): ../../../.pub-cache/hosted/pub.dev/syncfusion_flutter_charts-26.2.11/lib/src/charts/cartesian_chart.dart:1367:22: Error: The method 'markNeedsBuild' isn't defined for the class 'RenderConstrainedLayoutBuilder'. Could not build the application for the simulator. Error launching application on iPhone 11 Pro. ```

On which target platforms have you observed this bug?

iOS

Flutter Doctor output

Doctor output ```console [✓] Flutter (Channel stable, 3.24.1, on macOS 14.6.1 23G93 darwin-arm64, locale en-US) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.3) [✓] Chrome - develop for the web [✓] Android Studio (version 2023.3) [✓] IntelliJ IDEA Ultimate Edition (version 2024.2.0.2) [✓] VS Code (version 1.89.0) [✓] Connected device (4 available) [✓] Network resources • No issues found! ```
nguyenxdat commented 2 weeks ago

Same here

WCCSMobile23 commented 2 weeks ago

when i upgrade flutter then this issue in my project

PreethikaSelvam commented 2 weeks ago

Hi All,

The reported issue arises because the Flutter SDK was upgraded to version 3.24.0 on August 6, 2024, while our packages are currently compatible with Flutter SDK version 3.22.3. We almost completed evaluating the compatibility and feasibility of updating our packages to work with the latest Flutter version, 3.24.0. We plan to make our packages compatible and include them in our Volume 3 main release, which is expected to be rolled out in the second week of September. In the meantime, we kindly request that you use Flutter SDK version 3.22.3 when working with our syncfusion_flutter_charts package.

Regards, Preethika Selvam.

umairali435 commented 1 week ago

is there any solution without downgrading flutter ?

alarkirikal commented 1 week ago

I'm sorry, but that reply is disappointing. If all 3rd party packages would take the stance of forcing older Flutter levels instead of keeping up with the ecosystem, it'd be a chaos. It should be one of your core efforts to have support for official releases of Flutter.

jeanlucthumm commented 1 week ago

Fastest way to deal with this:

Install https://fvm.app/

Then run

fvm use 3.22.3
fvm flutter run
withden commented 4 days ago

I think they updated (Now it's compatible with Flutter 3.24): https://pub.dev/packages/syncfusion_flutter_charts/changelog

MrSuradechTH commented 4 days ago

latest version can run as normally

ThilipChandru commented 4 days ago

Hi All,

Thank you for your patience. We have upgraded our Flutter Charts package to be compatible with Flutter SDK 3.24.0. We kindly request you to upgrade Flutter Charts to the latest version.

Charts: https://pub.dev/packages/syncfusion_flutter_charts/versions/26.2.14

Regards, Thilip Chandru.