Skip to content

Data Type Import Issue: API Response Types Not Properly Imported from External FlutterFlow Library #6694

@MortadhaFadhlaoui

Description

@MortadhaFadhlaoui

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

When using FlutterFlow-generated API response types (e.g., ValidateOtpApiResponseStruct) in an external Flutter project, the data types are not being imported correctly.
This results in compilation errors — methods like ValidateOtpApiResponseStruct.fromMap() and related structs are not recognized or accessible, even though the FlutterFlow-generated library is correctly included as a dependency.

Example:

ValidateOtpApiResponseStruct.fromMap(result.data)

Error: Undefined class 'ValidateOtpApiResponseStruct'.

Environment:

FlutterFlow-generated project used as external dependency

Main Flutter project importing the FlutterFlow library

Dart SDK & Flutter versions compatible with FlutterFlow-generated code

File: lib/pages/onboarding/onboarding/onboarding_widget.dart
Lines: ~385–386

Expected Behavior

API response data types generated by FlutterFlow (e.g., ValidateOtpApiResponseStruct) should be properly imported and accessible when using the FlutterFlow library as an external dependency.
All related structs, .fromMap() methods, and response models should compile and function as expected, e.g.:

aumio_library_iri1io_data_schema
.ValidateOtpApiResponseStruct
.fromMap(result.data);

Steps to Reproduce

Generate a Flutter project using FlutterFlow that includes custom API calls with response structs (e.g., ValidateOtpApiResponseStruct).

Export that generated FlutterFlow project as a library or dependency.

Include the FlutterFlow library as a dependency in another Flutter project (via pubspec.yaml or local path).

In the main project, try using one of the API response structs from the FlutterFlow library, e.g.:

final response = ValidateOtpApiResponseStruct.fromMap(result.data);

Run the project — observe that the compiler throws an error stating the struct is undefined or not imported.

Reproducible from Blank

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

Bug Report Code (Required)

ITESl8n18cpgobgB0M7+acJ6hQMkQzM6bZI7ku1EdwEhNZCvP5k2YeDBclNLYteddFZ2GmH9kno0zM70v4bfNfJdC0yBQaZRyoRXQQ2VTk6nV5igPZaefkFAO+1gN2qF04mFsSR5CNdodGQYwGCyOvCdG3qCf9qOYwx5e6fDbOY=

Visual documentation

Environment

- FlutterFlow version: v6.4.11
- Platform: all
- Browser name and version: any
- Operating system and version affected: all

Additional Information

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions