Open DrNiels opened 4 weeks ago
Hi @DrNiels,
We have reproduced the issue you reported on our end and the issue is scheduled to be fixed in our upcoming weekly patch release on May 07, 2024. We will notify you here once the release has been rolled out, and we appreciate your patience in the meantime.
Regards, Lokesh P.
Hi,
The reported issue occurs particularly in the Hero widget when we attempt to navigate to the same page again with an empty chart data source. Due to its complexity, we are unable to resolve this issue within the planned timeline. We are currently working on it and will include the fix in our weekly patch, which is expected to roll out on May 21, 2024.
Regards, Lokesh P.
Hi @DrNiels ,
Currently we are working on this issue, but we need some confirmation your end. Can you please share the reason for reloading the same HeroCard widget again with same page?
Regards, Lavanya A.
Obviously, the example here is extremely simplified as I tried to create a minimal example that is easier to handle. In my real application, I provide multiple cards with different content that may include a syncfusion chart. Each card can be maximized, which we solve via routes. Feel free to check out the demo for our app (at this time still without Syncfusion Charts) and how the cards are maximized: https://demo.symcon.de/
Bug description
In my application, I get the following error when routing via MaterialPageRoute. In the provided example, it only seems to be cosmetic while my complete app completely fails. However, I hope that the issue remains the same. The structure with Hero and Card seems to be relevant as well as an empty data source.
In the example, the structure obviously seems unnecessary, but is required for proper maximizing in the complete app.
I use syncfusion_flutter_charts 25.1.40
Steps to reproduce
Route page by clicking the "ABC" icon button
Code sample
Code sample
```dart import 'package:flutter/material.dart'; import 'package:syncfusion_flutter_charts/charts.dart'; void main() async { runApp( MaterialApp( home: HeroCard(), ), ); } class HeroCard extends StatelessWidget { final GlobalKey styledCardKey = new GlobalKey(); @override Widget build(BuildContext context) { return Hero( tag: 'heroCard', child: Card( key: styledCardKey, // No error without key child: Row( children: [ SfCartesianChart( series: [ SplineSeriesScreenshots or Video
Not applicable, as the error is thrown but does not seem to cause any complications in the example. However, in my complete app, it definitely causes serious complications.
Stack Traces
Stack Traces
```dart ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ The following assertion was thrown while rebuilding dirty elements: setState() or markNeedsBuild() called during build. This CartesianChartArea widget cannot be marked as needing to build because the framework is already in the process of building widgets. A widget can be marked as needing to be built during the build phase only if one of its ancestors is currently building. This exception is allowed because the framework builds parent widgets before children, which means a dirty descendant will always be built. Otherwise, the framework might not visit this widget during this build phase. The widget on which setState() or markNeedsBuild() was called was: CartesianChartArea The widget which was currently being built when the offending call was made was: SplineSeriesOn which target platforms have you observed this bug?
Web
Flutter Doctor output
Doctor output
```console [√] Flutter (Channel stable, 3.19.5, on Microsoft Windows [Version 10.0.19045.4291], locale de-DE) • Flutter version 3.19.5 on channel stable at C:\Users\Niels\Documents\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 300451adae (3 weeks ago), 2024-03-27 21:54:07 -0500 • Engine revision e76c956498 • Dart version 3.3.3 • DevTools version 2.31.1 [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc4) • Android SDK at C:\Users\Niels\AppData\Local\Android\Sdk • Platform android-34, build-tools 34.0.0-rc4 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Users\Niels\AppData\Local\Google\Chrome\Application\chrome.exe [√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.6) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.8.34525.116 • Windows 10 SDK version 10.0.19041.0 [√] Android Studio (version 2021.2) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840) [√] VS Code, 64-bit edition (version 1.87.2) • VS Code at C:\Program Files\Microsoft VS Code • Flutter extension version 3.86.0 [√] Connected device (3 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.4291] • Chrome (web) • chrome • web-javascript • Google Chrome 123.0.6312.123 • Edge (web) • edge • web-javascript • Microsoft Edge 123.0.2420.97 [√] Network resources • All expected network resources are available. • No issues found! ```