Skip to content

TransactionResult doesn't allow abort on non dynamic data #71

@natebot13

Description

@natebot13
await database.ref('queue').transaction<Map<String, dynamic>>(
  (currentData) {
    print(currentData);
    if (currentData.length.isOdd) {
      print('aborting!');
      return TransactionResult.abort;
    }
    print('hand waving done');
    return TransactionResult.success(currentData);
  },
);

I'm running into a compile issue with this code. The transaction.abort line gives an error saying: The return type 'TransactionResult<dynamic>' isn't a 'TransactionResult<Map<String, dynamic>>', as required by the closure's context.

Am I allowed to specify the transaction type?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions