Currently we have the declaration
class SftpFileOpenMode {
...
operator |(SftpFileOpenMode other) => SftpFileOpenMode._(flag | other.flag);
}
The operator overload is declared without providing the desired return type which defaults it to dynamic.
This emits an error when compiled with Dart 3.0 "The argument 'dynamic' can't be assigned to the parameter type 'SftpFileOpenMode.'" in the sample below:
final file = await sftp.open(remoteFilename, mode: SftpFileOpenMode.create | SftpFileOpenMode.write);
The way to solve that is to specify explictly the return type of the "|" operator to be SftpFileOpenMode as shown in the sample below:
class SftpFileOpenMode {
...
SftpFileOpenMode operator |(SftpFileOpenMode other) => SftpFileOpenMode._(flag | other.flag);
}