Skip to content

FlutterFlowChartLegendWidget bad codegen #6445

@cristaloleg

Description

@cristaloleg

Can we access your project?

  • I give permission for members of the FlutterFlow team to access and test my project for the sole purpose of investigating this issue.

Current Behavior

Exception:

══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following _TypeError was thrown building FutureBuilder<ApiCallResponse>(dirty, dependencies:
[InheritedCupertinoTheme, MediaQuery, _InheritedTheme, _LocalizationsScope-[GlobalKey#82219]],
state: _FutureBuilderState<ApiCallResponse>#3ee59):
type 'List<dynamic>' is not a subtype of type 'List<LegendEntry>'

Expected Behavior

Should work normally and render the component.

The problem is that .map( loses type and .toList() returns List<dynamic> where it should be List<LegendEntry>:

.asMap()
.entries
.map( // throws an exception
// .map<LegendEntry>( // works
(label) =>
	LegendEntry(
	chartPieChartColorsList2[label.key %chartPieChartColorsList2.length],
	label.value,
),
)
.toList(),

Steps to Reproduce

  1. Create page with PieChart
  2. Add Legend labels from a variable (in my case HTTP response)
  3. See panic on iOS

Reproducible from Blank

  • The steps to reproduce above start from a blank project.

Bug Report Code (Required)

ITFXiMmBw891ofpE+aruaMExjmIwGUwbUOc7j9VEGAsjCeLmOuxzdc/sTEpoYuqHfFBUMFGJsH0H/vz8udjXFvcrAzmrGqJ6yM1bUxDjcFOhR4yxBquwZn9fN+RQN0eM0YmFhyJDJttfWmA+7zuqPtmAb3qCf9qOYwx5e6fDbOY=

Visual documentation

Image

Environment

- FlutterFlow version: v6.2.2
- Platform: iOS
- Browser name and version: Chrome
- Operating system and version affected: macOS

Additional Information

No responsef

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs triageA potential issue that has not been confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions