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.54k stars 752 forks source link

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

Open harsh-171095 opened 3 months ago

harsh-171095 commented 3 months ago

Bug description

while I reinstall latest version and try to build a app getting issue

 - 'RenderConstrainedLayoutBuilder' is from 'package:flutter/src/widgets/layout_builder.dart' ('../../../Flutter_SDK/flutter/packages/flutter/lib/src/widgets/layout_builder.dart').
 - 'Constraints' is from 'package:flutter/src/rendering/object.dart' ('../../../Flutter_SDK/flutter/packages/flutter/lib/src/rendering/object.dart').
 - 'RenderObject' is from 'package:flutter/src/rendering/object.dart' ('../../../Flutter_SDK/flutter/packages/flutter/lib/src/rendering/object.dart').
Try correcting the name to the name of an existing method, or defining a method named 'markNeedsBuild'.
        renderObject.markNeedsBuild();
                     ^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/syncfusion_flutter_charts-25.2.7/lib/src/charts/common/element_widget.dart:113:5: Error: The method 'markNeedsBuild' isn't defined for the class 'RenderChartElementLayoutBuilder<T, D>'.
 - 'RenderChartElementLayoutBuilder' is from 'package:syncfusion_flutter_charts/src/charts/common/element_widget.dart' ('../../../.pub-cache/hosted/pub.dev/syncfusion_flutter_charts-25.2.7/lib/src/charts/common/element_widget.dart').
Try correcting the name to the name of an existing method, or defining a method named 'markNeedsBuild'.
    markNeedsBuild();
    ^^^^^^^^^^^^^^
Failed to compile application.

Steps to reproduce

  1. install 'syncfusion_flutter_charts: ^25.2.6'
  2. build App

Code sample

build issue

Screenshots or Video

No

Stack Traces

No

On which target platforms have you observed this bug?

Web

Flutter Doctor output

../../../.pub-cache/hosted/pub.dev/syncfusion_flutter_charts-25.2.7/lib/src/charts/cartesian_chart.dart:1367:22: Error: The method 'markNeedsBuild' isn't defined for the class 'RenderConstrainedLayoutBuilder<Constraints, RenderObject>'.
 - 'RenderConstrainedLayoutBuilder' is from 'package:flutter/src/widgets/layout_builder.dart' ('../../../Flutter_SDK/flutter/packages/flutter/lib/src/widgets/layout_builder.dart').
 - 'Constraints' is from 'package:flutter/src/rendering/object.dart' ('../../../Flutter_SDK/flutter/packages/flutter/lib/src/rendering/object.dart').
 - 'RenderObject' is from 'package:flutter/src/rendering/object.dart' ('../../../Flutter_SDK/flutter/packages/flutter/lib/src/rendering/object.dart').
Try correcting the name to the name of an existing method, or defining a method named 'markNeedsBuild'.
        renderObject.markNeedsBuild();
                     ^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/syncfusion_flutter_charts-25.2.7/lib/src/charts/base.dart:3225:7: Error: The method 'markNeedsBuild' isn't defined for the class 'RenderLoadingIndicator'.
 - 'RenderLoadingIndicator' is from 'package:syncfusion_flutter_charts/src/charts/base.dart' ('../../../.pub-cache/hosted/pub.dev/syncfusion_flutter_charts-25.2.7/lib/src/charts/base.dart').
Try correcting the name to the name of an existing method, or defining a method named 'markNeedsBuild'.
      markNeedsBuild();
      ^^^^^^^^^^^^^^
mdeport commented 3 months ago

I have the same error

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

ghost commented 2 months ago

Hi @harsh-171095 | @mdeport,

We have checked the reported issue and tried to replicate it in the SfCartesianChart with version 26.1.35 by setting builder property of TrackballBehavior. And, we have tested with the following scenarios.

However, we were unable to reproduce the reported issue at our end. We kindly request you to replicate the reported issue in the sample attached below and provide us with more details regarding the specific scenario in which you encounter the issue with a screenshot or screen recording. This will help us to assist you more effectively.

Regards, Lokesh P.

github_1907.zip

TruongGlacio commented 2 months ago

Hi @LokeshPalani , Please reproduce with flutter sdk min version 3.22.2. This issuse happen with flutter sdk greater than 3.22.2. I am using flutter sdk 3.23.0-13.pre.145 from flutter Master channel, and this issue has happen

harsh-171095 commented 2 months ago

Hello @TruongGlacio Yes, I was try with the same Flutter SDK Version 3.22.2 and now it working fine.

Might be new flutter SDK Support are not done yet on library.

mdeport commented 2 months ago

hello @TruongGlacio thanks for the information now everything works fine

ghost commented 2 months ago

Hi @mdeport | @harsh-171095 | @TruongGlacio,

We would like to inform you that our latest Syncfusion Flutter packages are now only compatible with the latest Stable Flutter SDK version. We do not have plans to migrate the packages to the master channel as it is not a stable version and is still in the development phase. Therefore, we suggest using the latest Stable Flutter SDK to utilize our Syncfusion packages.

Furthermore, we have provided a link to the User Guide documentation below, which specifies the compatible Syncfusion package version for each Flutter SDK version.

UG Link: https://help.syncfusion.com/flutter/system-requirements#sdk-version-compatibility

Regards, Lokesh P.

babihutan commented 4 weeks ago

Well, flutter stable just got upgraded, so now my syncfusion pkgs don't work.

kyleorin commented 3 weeks ago

Well, flutter stable just got upgraded, so now my syncfusion pkgs don't work.

same here

newselfDevops commented 3 weeks ago

image

same error on Flutter 3.24.0, what can I do?

namhoangdev31 commented 3 weeks ago

same error on Flutter 3.24.0, what can I do?

Ảnh màn hình 2024-08-13 lúc 16 53 38
yknevenky commented 3 weeks ago

I too face the same

achilov1206 commented 3 weeks ago

Same issue with latest stable version of Flutter 3.24.0

babihutan commented 3 weeks ago

My workaround to get it to build is to use the 3.23 version of flutter:

Flutter 3.23.0-0.1.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 2feea7a407 (10 weeks ago) • 2024-06-06 10:19:10 +0700
Engine • revision bb10c54666
Tools • Dart 3.5.0 (build 3.5.0-180.3.beta) • DevTools 2.36.0
mukul218 commented 3 weeks ago

I am also facing same issue with latest flutter version Flutter 3.24.0

AmmarTN commented 3 weeks ago

Same here any updates or workaround it yet?

rakeshdas369 commented 3 weeks ago

me also facing the same issues.

flocbit commented 3 weeks ago

Yup, same problem.

adityadua24 commented 3 weeks ago

same problem after Flutter 3.24.0 upgrade ! Please tag me when someone fixes this 😅

aryata777 commented 3 weeks ago

I am also facing same issue with latest flutter version Flutter 3.24.0

pctin commented 3 weeks ago

Same problem with flutter 3.24.0

shahinshopon commented 2 weeks ago

@adityadua24 @pctin @flocbit @AmmarTN @rakeshdas369 I am also facing the same issue with the latest Flutter version 3.24.0 To solve this problem I have followed this :

../../../.pub-cache/hosted/pub.dev/syncfusion_flutter_charts-26.2.9/lib/src/charts/common/element_widge t.dart:117 ( Here 117 means line number ) ../../../.pub-cache/hosted/pub.dev/syncfusion_flutter_charts-26.2.9/lib/src/charts/base.dart:3317 ( Here 3317 means line number ) ../../../.pub-cache/hosted/pub.dev/syncfusion_flutter_charts-26.2.9/lib/src/charts/cartesian_chart.dart:1367 ( Here 1367 means line number ) ../../../.pub-cache/hosted/pub.dev/syncfusion_flutter_charts-26.2.9/lib/src/charts/common/core_tooltip.dart:168 ( Here 168 means line number ) ../../../.pub-cache/hosted/pub.dev/syncfusion_flutter_charts-26.2.9/lib/src/charts/common/core_legend.dart:452 ( Here 452 means line number ) Just need to change markNeedsBuild to markNeedsLayout In this dart file. Hope the problem will be solved.

temuujinnn commented 2 weeks ago

I am also facing the same issue with the latest Flutter version 3.24.0

gaddlord commented 2 weeks ago

I have downgraded all Syncfusion libs to 22.2.9 to bypass the problem. That forced also intl to go down to "intl: ^0.18.0"

syncfusion_flutter_charts: ^22.2.9 # HACK Downgraded due to https://github.com/syncfusion/flutter-widgets/issues/1907

ahmeedev commented 2 weeks ago

same issue

Steven-Douglass commented 2 weeks ago

same issue

lucas-bernardino commented 2 weeks ago

I also got this issue. I solved it by going to the flutter installation folder and downgrading to version 3.22.1. You can do that with: git checkout 3.22.1

MoonEunki commented 2 weeks ago

I'm using syncfusion_flutter_charts: ^26.2.10, and after switching to Flutter version 3.22.1 using FVM, it works

prologikus commented 2 weeks ago

reopen this issue as it's faced in the lasted flutter sdk

Steven-Douglass commented 2 weeks ago

Same issue

PreethikaSelvam commented 1 week 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 have begun 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.

aktarulahsan commented 1 week ago

I have solution.

Solution : go to this path

('../../../../Development/flutter/packages/flutter/lib/src/rendering/object.dart').

and write a function like

void markNeedsBuild() { markNeedsLayout(); } now run your project. you can see more https://stackoverflowjava.blogspot.com/2024/08/error-method-markneedsbuild-isnt.html

mahfuzur32785 commented 1 week ago
  1. On Windows: It might be in C:\flutter or another directory where you extracted it.

  2. Navigate to the Target File Once you've located the SDK:

Go to the packages/flutter/lib/src/widgets/ directory. Open the layout_builder.dart file in a text editor.

  1. Modify the layout_builder.dart File Find the RenderConstrainedLayoutBuilder mixin and add the markNeedsBuild method:

dart Copy code mixin RenderConstrainedLayoutBuilder on RenderObject { // Other existing code...

void markNeedsBuild() { markNeedsLayout(); } }

Ander0106 commented 1 week ago

solution is in this link, to me the problem is al ready https://stackoverflow.com/questions/78882125/how-to-solve-the-issue-of-renderobject-markneedsbuild-not-present-in-flutter

JakDeveloper commented 1 week ago
  1. On Windows: It might be in C:\flutter or another directory where you extracted it.
  2. Navigate to the Target File Once you've located the SDK:

Go to the packages/flutter/lib/src/widgets/ directory. Open the layout_builder.dart file in a text editor.

  1. Modify the layout_builder.dart File Find the RenderConstrainedLayoutBuilder mixin and add the markNeedsBuild method:

dart Copy code mixin RenderConstrainedLayoutBuilder on RenderObject { // Other existing code...

void markNeedsBuild() { markNeedsLayout(); } }

This works.

moin-maniar commented 1 week ago

I am using flutter 3.22.0 and facing the same issue. Is there any luck?

aktarulahsan commented 1 week ago

I have solution.

Solution : go to this path

('../../../../Development/flutter/packages/flutter/lib/src/rendering/object.dart').

and write a function like

void markNeedsBuild() { markNeedsLayout(); } now run your project. you can see more https://stackoverflowjava.blogspot.com/2024/08/error-method-markneedsbuild-isnt.html

withden commented 1 week ago

I have solution.

Solution : go to this path

('../../../../Development/flutter/packages/flutter/lib/src/rendering/object.dart').

and write a function like

void markNeedsBuild() { markNeedsLayout(); } now run your project. you can see more https://stackoverflowjava.blogspot.com/2024/08/error-method-markneedsbuild-isnt.html

Hey,

Is this only work on your computer? Because you are trying to edit flutter framework codebase.

ekuleshov commented 3 days ago

It is very disappointing to see it taking 3 months and over 30 reports to fix an issue related to using a deprecated Flutter API.

A proposed solution to downgrade Flutter is no go - many packages bumped their minimal version of SDK.

withden commented 2 days ago

@saurabhkumar-sk and others: is it good to modify the Flutter codebase?

I don't think it's good to change the Flutter framework codebase

ekuleshov commented 2 days ago

If the fix is that simple, what is stopping Syncfusion from replacing that method call in 4 places in their package(s) and releasing an update today?

jeanlucthumm commented 2 days ago

@ekuleshov notice the solution involves changing internal Flutter code so it's not really a solution

ekuleshov commented 2 days ago

@ekuleshov notice the solution involves changing internal Flutter code so it's not really a solution

I am well aware. It can't be used with any CI or automated build systems. My comment was about changing the Syncfusion chart package to replace all calls to deprecated/removed method with a method that is being rerouted to. Shouldn't take more than 30 seconds to do so and definitely not 3 months.

gakuru commented 2 days ago

Using Flutter 3.24.1 The issue mostly seems to be emanating from the markNeedsBuild, apparently changing it to markNeedsLayout seems to make the build run

robinmonsere commented 10 hours ago

Any updates on this?

babahmed commented 10 hours ago

Any updates on this?

None, 3 releases within the last month, and non fixes the issue.