Commit class abstract

Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature.

Available extensions
Annotations
  • @freezed

Constructors

Commit.new({@Default('com.atproto.sync.subscribeRepos#commit') String $type, required int seq, required String repo, required String commit, required String rev, required String? since, required Map<String, dynamic> blocks, @RepoOpConverter() required List<RepoOp> ops, String? prevData, required DateTime time, Map<String, dynamic>? $unknown})
const
factory
Commit.fromJson(Map<String, Object?> json)
factory

Properties

$type String
no setterinherited
$unknown Map<String, dynamic>?
no setterinherited
blocks Map<String, dynamic>
CAR file containing relevant blocks, as a diff since the previous repo state. The commit must be included as a block, and the commit block CID must be the first entry in the CAR header 'roots' list.
no setterinherited
commit String
Repo commit object CID.
no setterinherited
copyWith → $CommitCopyWith<Commit>
Create a copy of Commit with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasNotPrevData bool

Available on Commit, provided by the CommitExtension extension

no setter
hasPrevData bool

Available on Commit, provided by the CommitExtension extension

no setter
ops List<RepoOp>
List of repo mutation operations in this commit (eg, records created, updated, or deleted).
no setterinherited
prevData String?
The root CID of the MST tree for the previous commit from this repo (indicated by the 'since' revision field in this message). Corresponds to the 'data' field in the repo commit object. NOTE: this field is effectively required for the 'inductive' version of firehose.
no setterinherited
repo String
The repo this event comes from. Note that all other message types name this field 'did'.
no setterinherited
rev String
The rev of the emitted commit. Note that this information is also in the commit object included in blocks, unless this is a tooBig event.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
seq int
The stream sequence number of this message.
no setterinherited
since String?
The rev of the last emitted commit from this repo (if any).
no setterinherited
time DateTime
Timestamp of when this message was originally broadcast.
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_Commit value)) → TResult

Available on Commit, provided by the CommitPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_Commit value)?) → TResult?

Available on Commit, provided by the CommitPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_Commit value)?, {required TResult orElse()}) → TResult

Available on Commit, provided by the CommitPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(String $type, int seq, String repo, String commit, String rev, String? since, Map<String, dynamic> blocks, List<RepoOp> ops, String? prevData, DateTime time, Map<String, dynamic>? $unknown)?, {required TResult orElse()}) → TResult

Available on Commit, provided by the CommitPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this Commit to a JSON map.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(String $type, int seq, String repo, String commit, String rev, String? since, Map<String, dynamic> blocks, List<RepoOp> ops, String? prevData, DateTime time, Map<String, dynamic>? $unknown)) → TResult

Available on Commit, provided by the CommitPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(String $type, int seq, String repo, String commit, String rev, String? since, Map<String, dynamic> blocks, List<RepoOp> ops, String? prevData, DateTime time, Map<String, dynamic>? $unknown)?) → TResult?

Available on Commit, provided by the CommitPatterns extension

A variant of when that fallback to returning null

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

validate(Map<String, dynamic> object) bool

Constants

knownProps → const List<String>