Skip to content

Flutter SDK Row.fromMap drops flattened TablesDB row data in 24.1.0+ #1561

@sgaabdu4

Description

@sgaabdu4

Summary

The generated Flutter SDK Row.fromMap drops flattened TablesDB row columns in appwrite 24.1.0 and later.

This breaks TablesDB.getRow() / TablesDB.listRows() when Appwrite Cloud returns row columns at the top level, because Row.data becomes {}.

Affected SDK

  • Flutter package: appwrite
  • Broken in: 24.1.0, 24.1.1, 24.2.0
  • Works in: 18.0.0, 20.3.0, 23.0.0, 24.0.0

Current generated code

In appwrite 24.2.0:

factory Row.fromMap(Map<String, dynamic> map) {
  return Row(
    $id: map['$id'].toString(),
    $sequence: map['$sequence'].toString(),
    $tableId: map['$tableId'].toString(),
    $databaseId: map['$databaseId'].toString(),
    $createdAt: map['$createdAt'].toString(),
    $updatedAt: map['$updatedAt'].toString(),
    $permissions: List.from(map['$permissions'] ?? []),
    data: Map<String, dynamic>.from(map["data"] ?? {}),
  );
}

Regression

Older generated SDK versions preserved flattened fields:

18.0.0   data: map,
20.3.0   data: map["data"] ?? map,
23.0.0   data: map["data"] ?? map,
24.0.0   data: map["data"] ?? map,
24.1.0   data: Map<String, dynamic>.from(map["data"] ?? {}),
24.1.1   data: Map<String, dynamic>.from(map["data"] ?? {}),
24.2.0   data: Map<String, dynamic>.from(map["data"] ?? {}),

Reproduction

Given a row payload shaped like this:

{
  "supported_versions": ["1.2.4", "1.2.5"],
  "$sequence": "1",
  "$id": "row_id",
  "$createdAt": "2026-01-01T00:00:00.000+00:00",
  "$updatedAt": "2026-01-01T00:00:00.000+00:00",
  "$permissions": [],
  "$databaseId": "database_id",
  "$tableId": "table_id"
}

Run:

final row = Row.fromMap(payload);
print(row.data['supported_versions']);

Actual behavior

With appwrite 24.1.0+:

row.data == {}
row.data['supported_versions'] == null

Expected behavior

The SDK should preserve custom row columns in Row.data:

row.data['supported_versions'] == ['1.2.4', '1.2.5']

Why this matters

Client code using the public SDK and TablesDB.getRow() cannot read custom row columns when Appwrite Cloud returns flattened row data.

This caused a production version-gate check to fail closed even though the row existed and the column was present.

Suggested fix

Restore the previous fallback behavior:

data: Map<String, dynamic>.from(map["data"] ?? map),

or otherwise normalize flattened row columns into Row.data.

The SDK should not require users to call private client.call, REST endpoints, or deprecated Databases APIs to access TablesDB row data.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions